don't give template arguments to make_iterator_range
Hi,
I recently came across an issue with make_iterator_range(), which is
used to externally construct iterator_range objects. The problem is
that if a template argument is explicitly specified, gcc 4.8.2 refuses
to compile the code. In the meantime, clang 3.4 compiles it without
warnings. This runs contrary to the intuition that specifying a template
argument can only help (speed up) compilation.
You might want to make a note about this in the documentation to Boost
Range: "Don't give an explicit template argument to
make_iterator_range! If you do, the program will be ill-formed!"
The heavily simplified problem is explained here:
http://stackoverflow.com/questions/22258054/c-inconsistency-between-gcc-and-...
The internal Boost Range details are the following.
As described here:
http://www.boost.org/doc/libs/1_55_0/libs/range/doc/html/range/reference/uti...
make_iterator_range has 5 overloads, all of which are template
functions. Consider the 1st and 4th overloads:
template <typename It>
iterator_range<It>
make_iterator_range(It, It);
template <typename R>
iterator_range
participants (1)
-
Matei David