Workaround MSVC 14.1 problem with template specialization partial ordering that caused compilation failure when next/prior is used with pointers. Added a test.

This commit is contained in:
Andrey Semashev
2017-08-27 17:31:34 +03:00
parent 3275ee3c82
commit 0c6b09ef6a
2 changed files with 18 additions and 3 deletions

View File

@ -46,13 +46,13 @@ namespace next_prior_detail {
// Since C++17 we can test for iterator_traits<T>::iterator_category presence instead as it is
// required to be only present for iterators.
template< typename T, typename Void = void >
struct is_iterator
struct is_iterator_class
{
static BOOST_CONSTEXPR_OR_CONST bool value = false;
};
template< typename T >
struct is_iterator<
struct is_iterator_class<
T,
typename enable_if_has_type<
#if !defined(BOOST_NO_CXX17_ITERATOR_TRAITS)
@ -67,7 +67,13 @@ struct is_iterator<
};
template< typename T >
struct is_iterator< T*, void >
struct is_iterator :
public is_iterator_class< T >
{
};
template< typename T >
struct is_iterator< T* >
{
static BOOST_CONSTEXPR_OR_CONST bool value = true;
};