ranges and views for stack, queue, and priority_queue
I've always felt that exposing iterators for `std::stack` or `std::queue` doesn't quite make sense because iterating over them would typically change their state.
That said, the range features introduced in C++20/23 are just too tempting. 😄
I bet many C++ developers have had this thought at least once:
queue | views::values | views::to<std::vector>()
...or more generally, "What if I could use the ranges pipeline directly on a queue or stack?"
So I spent some time experimenting to see if I could make it work. Here's what I came up with.
[https://cognosnotes.com/blog/cpp-pop-range](https://cognosnotes.com/blog/cpp-pop-range/?v=2)
https://redd.it/1vbcuwa
@r_cpp
Post #25700
21