Boost iterators aren't SFINAE-friendly. This is a problem when building
traits
that detect certain behavior. Heres a simple example:
#include <vector>
#include
#include
template<class>
struct holder
{
typedef void type;
};
template
struct is_advanceable
: std::false_type
{};
template<class Iterator>
struct is_advanceable() += std::declval<int>())
>::type>
: std::true_type
{};
static_assert(is_advanceablestd::vector<int::iterator>::value,
"This will pass");
struct predicate
{
template<class T>
bool operator()(T&&) const;
};
static_assert(not is_advanceable::iterator>>::value, "This won't pass");
Although, it doesn't always lead to a compile error(rather than subtitution
failure), it does lead some very erroneous errors.
Thanks,
Paul
--
View this message in context: http://boost.2283326.n4.nabble.com/Boost-iterators-are-not-SFINAE-friendly-t...
Sent from the Boost - Dev mailing list archive at Nabble.com.