News for hackers. Stuff that matters.
Re:Making Your Own Container Compatible with C++20 Ranges by nly on Monday March 22, 2021 @10:09PM (#26550178)
I'm not sure if this situation has improved in C++20, but writing iterator types properly in classic C++ really sucks, and this article glosses over a lot of the details.

I've always used Boosts iterator_facade to do this: https://www.boost.org/doc/libs/1_75_0/libs/iterator/doc/iter... , which requires you only implement a maximum of 6 functions for any iterator type.

Re:Making Your Own Container Compatible with C++20 Ranges by _slyo on Monday March 22, 2021 @10:25PM (#26550288)
Boost.STLInterfaces provides a more modern alternative to iterator_facade.

https://www.boost.org/doc/libs/1_75_0/doc/html/stl_interface...

Re:Making Your Own Container Compatible with C++20 Ranges by nly on Monday March 22, 2021 @11:25PM (#26550708)
Yes, indeed! Thanks
Re:Making Your Own Container Compatible with C++20 Ranges by _huayra_ on Tuesday March 23, 2021 @04:51AM (#26552596)
The author gave a great talk on this at cppcon last year: https://www.youtube.com/watch?v=JByCzWaGxhE