Open h-2 opened 6 years ago
The custom view in the article doesn't work when called next to each other.
std::vector<int> vec{1, 5, 6, 8, 5}; auto v = vec | ranges::views::transform([] (int const i) { return i*i; }) | view::add_constant | view::add_constant | ranges::views::drop(2); std::cout << *std::begin(v) << '\n'; // prints '136' instead of '236'
I tried to reason through the code and try to debug it, but I'm a novice. Could you try fixing it and provide an explanation?
The custom view in the article doesn't work when called next to each other.
I tried to reason through the code and try to debug it, but I'm a novice. Could you try fixing it and provide an explanation?