microsoft/Range-V3-VS2015

ranges::view::empty() causes "Conversion loses qualifiers" error

rdeterre opened this issue · 0 comments

Hi,

I'm very new to Range v3 so this might be a misunderstanding on my end. Calling remove_if on a constant range and querying the result with empty() causes a build failure on Visual Studio 2015. Here is code that causes this:

std::vector<int> v { 6, 2, 3, 4, 5, 6 };
auto rng = v | ranges::view::remove_if([](int i) {return i>0;});
std::cout << "empty:  " << rng.empty()<< "\n";

The error is quite verbose. I copied it in the file below.

Replacing rng.empty() with rng.begin() == rng.end() makes this error go away.

The same code works on Wandbox using GCC. The version on which I see the problem is the one tagged vcpkg5.

error.log