This template implements a proxy for containers that contain a collection of items normally accessed with a get-by-index method.
More...
template<class T, class R, typename I, I(T::*)() const Count, R *(T::*)(I) const Access>
class ml::ContainerProxy< T, R, I, Count, Access >
This template implements a proxy for containers that contain a collection of items normally accessed with a get-by-index method.
Due to this structure, it is not possible to use them in any STL-compatible algorithm or range-based for-loop. This way, the proxy provides a begin()/end() pair that follows the standard STL conventions. Note that calling *end() is not advisable.
By defining a proxy like:
using TreeWidgetProxy = ContainerHelpers::ContainerProxy<QTreeWidget,
QTreeWidgetItem,
int,
&QTreeWidget::topLevelItemCount,
&QTreeWidget::topLevelItem>;
auto element = SCR::in(TreeWidgetProxy(*myListView)).find([&value](QTreeWidgetItem* item)
{ return item->text(0) == value; }).or_return_nullptr();
Note: It is not wise to add or remove items within any loop!
Definition at line 65 of file mlContainerHelpers.h.