3 ms·
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 th
by nly 6y ago
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/iterator_facade.html#implementing-the-core-operations 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.
- ubadair 6y agoBoost.STLInterfaces provides a more modern alternative to iterator_facade. https://www.boost.org/doc/libs/1_75_0/doc/html/stl_interfaces.html https://www.boost.org/doc/libs/1_75_0/doc/html/stl_interface...