#include <vector>
#include <iostream>
#include <range/v3/all.hpp>
int main()
{
auto coll = std::vector{ 1, 2, 3 };
ranges::copy(
coll,
ranges::ostream_iterator<int>{ std::cout, ", " }
); // ok
ranges::copy(
coll,
std::ostream_iterator<int>{ std::cout, ", " }
); // error
}
The issue is shown in the code above. I use ranges-v3-0.3.7.
To me, the generic algorithm copy shouldn't care about the destination iterator type as long as it meets the requirements of output iterator.
If so, why aren't ranges' algorithms compatible with std's iterators?