Clang 3.8.1 with libC ++ compiles the following program:
#include <vector> #include <iterator> #include <algorithm> #include <iostream> #include <boost/range/iterator_range.hpp> int main() { const std::vector<int> v {1, 2, 3}; const auto range = boost::make_iterator_range(v); std::copy(std::crbegin(range), std::crend(range), std::ostream_iterator<int> {std::cout, " "}); std::cout << std::endl; return 0; }
But gcc 6.1.0 with libstdc ++ does not. First line of gcc error:
error: no matching function for call to 'crbegin(const boost::iterator_range<__gnu_cxx::__normal_iterator<const int*, std::vector<int> > >&
Who is right?
Note : Boost version 1.61
source share