Shouldn't drop_last produce an empty range if the source range has fewer elements than to be dropped?
("Given a source range and an integral count, return a range consisting of all but the last count elements from the source range, or an empty range if it has fewer elements." - https://ericniebler.github.io/range-v3/index.html#autotoc_md8)
for (std::vector one{ 1 }; auto i : one | ranges::views::drop_last(2)) {
std::cout << i;
}
Shouldn't
drop_last
produce an empty range if the source range has fewer elements than to be dropped? ("Given a source range and an integral count, return a range consisting of all but the last count elements from the source range, or an empty range if it has fewer elements." - https://ericniebler.github.io/range-v3/index.html#autotoc_md8)drop_last.hpp(53):
RANGES_EXPECT(initial_size >= n);
https://godbolt.org/z/81Kvs8