Hi, just to express my interest in this. I already have a legacy project
where this could be useful and if it were to land in boost (or in the
standard) it would be great. Thanks for doing this.
Do you think that the code is already useable, or is there something "big"
left to do? I hope to give it a try in some days and of course will report
back to you if there is anything relevant or useful.
Francesco
Il dom 11 ago 2019, 04:21 Zach Laine via Boost
I write a lot of iterators, and I'm getting sick of doing it by hand. I can't use Boost.Iterator's iterator_facade in library code, since it knows nothing about constexpr and noexcept.
The design of Boost.Iterator's iterator_facade does not lend itself very well to being modified in a direction that is standardization-friendly (reasons why are outlined in the online docs).
So, here is one take on this problem:
GitHub: https://github.com/tzlaine/iterator_facade
Online Docs: https://tzlaine.github.io/iterator_facade
For those unfamiliar with the problem, iterators are very simple, at the highest level of abstraction. An iterator's implementation does not reflect this -- it is highly repetitive and easy to get subtly wrong. This library fixes that.
The library is forward-looking, since I intend to write WG21 papers to standardize iterator_facade; there is good support for upcoming C++20 library features. In particular, the iterators created with iterator_facade model the C++20 iterator concepts, and therefore do not necessarily match the requirements of the C++17-and-earlier requirement tables. I have not found this to affect the usability of iterator-facade-based iterators with pre-C++20 code.
Something to note: there was a recent-ish attempt to stanrdize iterator_facade, which is now abandoned, P0186 (http://wg21.link/P0186). This was very different from what I'm proposing for Boost. I talked to Eric Niebler about this, and he favors a return to the CRTP-based approach of my lib and the original Boost.Iterator iterator_facade library.
Zach
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost