Is const broken with std::views?
void foo(const auto& collection) { *collection.begin() = 104; } int main() { std::vector<int> ints {1, 2, 3, 4, 5}; foo(ints); // Error, as it should be foo(ints | std::views::all); // Compiles and modifies the vector. Why? return 0; } Why is constness of lvalue reference completely ignored if an argument of a function is of… Read More Is const broken with std::views?