diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-07-23 15:25:44 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-07-23 15:25:44 +0200 |
commit | 8286ac511144e4f17d34eac9affb97e50646344a (patch) | |
tree | f1af7320d7b6be6be059216d0ad08ac7b4f73fd0 /libcutl/cutl/details/boost/iterator/iterator_traits.hpp | |
parent | a15cf65c44d5c224169c32ef5495b68c758134b7 (diff) |
Imported Upstream version 4.0.0upstream/4.0.0
Diffstat (limited to 'libcutl/cutl/details/boost/iterator/iterator_traits.hpp')
-rw-r--r-- | libcutl/cutl/details/boost/iterator/iterator_traits.hpp | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/libcutl/cutl/details/boost/iterator/iterator_traits.hpp b/libcutl/cutl/details/boost/iterator/iterator_traits.hpp new file mode 100644 index 0000000..449c91d --- /dev/null +++ b/libcutl/cutl/details/boost/iterator/iterator_traits.hpp @@ -0,0 +1,92 @@ +// Copyright David Abrahams 2003. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef ITERATOR_TRAITS_DWA200347_HPP +# define ITERATOR_TRAITS_DWA200347_HPP + +# include <cutl/details/boost/detail/iterator.hpp> +# include <cutl/details/boost/detail/workaround.hpp> + +namespace cutl_details_boost { + +// Unfortunately, g++ 2.95.x chokes when we define a class template +// iterator_category which has the same name as its +// std::iterator_category() function, probably due in part to the +// "std:: is visible globally" hack it uses. Use +// BOOST_ITERATOR_CATEGORY to write code that's portable to older +// GCCs. + +# if BOOST_WORKAROUND(__GNUC__, <= 2) +# define BOOST_ITERATOR_CATEGORY iterator_category_ +# else +# define BOOST_ITERATOR_CATEGORY iterator_category +# endif + + +template <class Iterator> +struct iterator_value +{ + typedef typename cutl_details_boost::detail::iterator_traits<Iterator>::value_type type; +}; + +template <class Iterator> +struct iterator_reference +{ + typedef typename cutl_details_boost::detail::iterator_traits<Iterator>::reference type; +}; + + +template <class Iterator> +struct iterator_pointer +{ + typedef typename cutl_details_boost::detail::iterator_traits<Iterator>::pointer type; +}; + +template <class Iterator> +struct iterator_difference +{ + typedef typename cutl_details_boost::detail::iterator_traits<Iterator>::difference_type type; +}; + +template <class Iterator> +struct BOOST_ITERATOR_CATEGORY +{ + typedef typename cutl_details_boost::detail::iterator_traits<Iterator>::iterator_category type; +}; + +# if BOOST_WORKAROUND(BOOST_MSVC, < 1300) +template <> +struct iterator_value<int> +{ + typedef void type; +}; + +template <> +struct iterator_reference<int> +{ + typedef void type; +}; + +template <> +struct iterator_pointer<int> +{ + typedef void type; +}; + +template <> +struct iterator_difference<int> +{ + typedef void type; +}; + +template <> +struct BOOST_ITERATOR_CATEGORY<int> +{ + typedef void type; +}; +# endif + +} // namespace cutl_details_boost::iterator + +#endif // ITERATOR_TRAITS_DWA200347_HPP |