If I try to put a boost::iterator_range into a boost::variant, it breaks
the variant, because something in boost::iterator_range doesn't allow
variant to use SFINAE deduction. My best guess at the problem is the
declarations in boost/range/iterator_range_core.hpp that have a 'class
ForwardRange' template argument are insufficiently constrained
and accept almost anything as a possible ForwardRange type.
I'm guessing that putting the correct enable_if<> template constraints
on the templates that use 'ForwardRange' will fix the issue, but I'm
having trouble identifing the correct metafunction test to use, since
concept FowardRange concept doesn't have too many good targets.
I'd like to test a candidate FowardRange type to see if boost::begin()
and boost::end() can be successfully called on it, but I haven't figured
out how to do that yet.
Any suggestions? Known fixes or workarounds? I know about the
has_range_iterator metafunction, but it can't be used here due to
circular definition issues...
Exmaple:
#include