Is there, or how would you write, a metafunction class that tests whether a class is compatible with boost::range? I want to use the boost::enable idiom, something like
template <typename T>
Constructor::Constructor(const T& t, __attribute__((unused)) typename boost::enable_if<is_range_compatible<T> >::type* aux=NULL)
for an appropriate is_range_compatible metafunction. I know about is_container from pretty_print, which captures a lot of cases, but not everything that works with boost::range.
Edit This is using C++03, so I don't have access to C++11 features. I'm using an old, gcc 4.1, and boost 1.51.
Do you mean
enable_if?If you can persuade the Boost concept checks to work usefully with it (instead of the macro + compile error it uses now), checks like
ForwardConceptRangeare already provided.Otherwise, is it a problem to use the existing
BOOST_CONCEPT_ASSERTmacro instead?