Почему я не могу (пере)присвоить значение представлению, даже если оно того же типа? Демо(https://godbolt.org/z/aqdh7ohva) ) [code]#include #include #include
int main() { std::vector v = { 0, 1, 2, 3, 4, 5, 6 };
const bool strategy_check_for_zero = true;
auto selected = v | std::views::filter([=](const auto& v) { return !strategy_check_for_zero || v != 0; });
// Impossible to do; why? selected = v | std::views::filter([=](const auto& v) { return true; });