mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +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
792d0538d2
commit
2722fdcda3
@ -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