mirror of
https://github.com/boostorg/iterator.git
synced 2025-05-12 05:51:37 +00:00
Use std::iterator_traits to detect iterators, when possible.
This allows next/prior to detect user's iterators that do not define iterator_category nested type but specialize std::iterator_traits instead.
This commit is contained in:
parent
e3577e7687
commit
5f6fd2dec6
@ -52,7 +52,16 @@ struct is_iterator
|
|||||||
};
|
};
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
struct is_iterator< T, typename enable_if_has_type< typename T::iterator_category >::type >
|
struct is_iterator<
|
||||||
|
T,
|
||||||
|
typename enable_if_has_type<
|
||||||
|
#if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS)
|
||||||
|
typename std::iterator_traits< T >::iterator_category
|
||||||
|
#else
|
||||||
|
typename T::iterator_category
|
||||||
|
#endif
|
||||||
|
>::type
|
||||||
|
>
|
||||||
{
|
{
|
||||||
static BOOST_CONSTEXPR_OR_CONST bool value = true;
|
static BOOST_CONSTEXPR_OR_CONST bool value = true;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user