123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- #ifndef BOOST_ITERATOR_IS_ITERATOR_HPP_INCLUDED_
- #define BOOST_ITERATOR_IS_ITERATOR_HPP_INCLUDED_
- #include <cstddef>
- #include <boost/config.hpp>
- #include <boost/type_traits/integral_constant.hpp>
- #include <boost/type_traits/negation.hpp>
- #include <boost/type_traits/conjunction.hpp>
- #include <boost/type_traits/is_complete.hpp>
- #include <boost/type_traits/is_function.hpp>
- #if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS)
- #include <iterator>
- #endif
- #ifdef BOOST_HAS_PRAGMA_ONCE
- #pragma once
- #endif
- namespace boost {
- namespace iterators {
- namespace detail {
- namespace has_iterator_category_detail {
- typedef char yes_type;
- struct no_type { char padding[2]; };
- template< typename T >
- yes_type check(
- #if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS)
- typename std::iterator_traits< T >::iterator_category*
- #else
- typename T::iterator_category*
- #endif
- );
- template< typename >
- no_type check(...);
- }
- template< typename T >
- struct is_iterator_impl :
- public boost::integral_constant<
- bool,
- sizeof(has_iterator_category_detail::check< T >(0)) == sizeof(has_iterator_category_detail::yes_type)
- >
- {
- };
- template< typename T >
- struct is_iterator_impl< T* > :
- public boost::conjunction<
- boost::is_complete< T >,
- boost::negation< boost::is_function< T > >
- >::type
- {
- };
- template< typename T, typename U >
- struct is_iterator_impl< T U::* > :
- public boost::false_type
- {
- };
- template< typename T >
- struct is_iterator_impl< T& > :
- public boost::false_type
- {
- };
- template< typename T, std::size_t N >
- struct is_iterator_impl< T[N] > :
- public boost::false_type
- {
- };
- #if !defined(BOOST_TT_HAS_WORKING_IS_COMPLETE)
- template< typename T >
- struct is_iterator_impl< T[] > :
- public boost::false_type
- {
- };
- template< >
- struct is_iterator_impl< void > :
- public boost::false_type
- {
- };
- template< >
- struct is_iterator_impl< void* > :
- public boost::false_type
- {
- };
- #endif
- }
- template< typename T >
- struct is_iterator : public detail::is_iterator_impl< T >::type {};
- template< typename T >
- struct is_iterator< const T > : public detail::is_iterator_impl< T >::type {};
- template< typename T >
- struct is_iterator< volatile T > : public detail::is_iterator_impl< T >::type {};
- template< typename T >
- struct is_iterator< const volatile T > : public detail::is_iterator_impl< T >::type {};
- }
- using iterators::is_iterator;
- }
- #endif
|