Interest in STL interface templates for iterators, views, and containers? (Was: Interest in updated, standalone iterator_facade library?)
On Wed, Aug 14, 2019 at 10:44 AM Zach Laine
On Wed, Aug 14, 2019 at 4:44 AM Hans Dembinski
wrote: [snip]
Since iterator_interface is a lot more like Boost.Iterator's iterator_adaptor than my previous iterator_facade was (and I'll look into that), it may be possible to make one template that does everything, but I will not include two separate templates.
If you could merge the two that would be even better, but I am not sure you can.
I can, and I did last night. You can see an example here (not that this is not the master branch):
https://github.com/tzlaine/iterator_facade/blob/interface_alternative/exampl...
When I get MSVC fixed, I'll merge all this to master.
This is now done. The focus of the library is now a bit different. All the iterator bits are still there, but now iterator_facade is called iterator_interface, and has facilities for acting more like an iterator_facade and more like an iterator_adaptor. One of the new things is an implementation of C++20's view_interface. Give it a range or view, even one with only begin() and end(), and it gives you all the view-type API that can be supported from begin() and end(), based on the iterator types and categories. The other new thing is container_interface. It is analogous to view_interface, but instead of supporting definition of new view types, it supports the definition of new containers. It has support for all the operations in the sequence container and reversible container requirements in the standard. In the example in the docs, I was able to write a static_vector, for which container_interface provided 38(!) of the member functions. Finally, the library's name has changed to reflect all this. You can now get the code here: https://github.com/tzlaine/stl_interfaces and see the online docs here: https://tzlaine.github.io/stl_interfaces/doc/html/index.html Zach
participants (1)
-
Zach Laine