Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ah-iterator.H File Reference

STL-compatible iterator adapters for Aleph containers. More...

#include <compare>
#include <iterator>
#include <concepts>
#include <type_traits>
#include <utility>
Include dependency graph for ah-iterator.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  StlIterator< SetType >
 STL-compatible mutable iterator adapter for Aleph containers. More...
 
struct  Aleph::const_iterator_detail::const_item< R >
 What a read-only view hands out for an item handed out as R: a reference becomes a reference to const, a pointer a pointer to const and a value stays a value. More...
 
struct  Aleph::const_iterator_detail::const_item< T & >
 
struct  Aleph::const_iterator_detail::const_item< T * >
 
struct  Aleph::const_iterator_detail::item_type_of< It, class >
 Carries the Item_Type of the iterator It, when it has one. More...
 
struct  Aleph::const_iterator_detail::item_type_of< It, std::void_t< typename It::Item_Type > >
 
struct  Aleph::const_iterator_detail::member_types_of< It, class >
 Carries the Set_Type of the iterator It, when it has one, on top of its Item_Type. More...
 
struct  Aleph::const_iterator_detail::member_types_of< It, std::void_t< typename It::Set_Type > >
 
class  Aleph::Const_Iterator< It >
 Read-only view of an Aleph iterator: the iterator of a constant container. More...
 
struct  StlConstIterator< SetType >
 STL-compatible const iterator adapter for Aleph containers. More...
 
class  StlAlephIterator< SetName >
 Mixin that adds STL begin()/end() and cbegin()/cend() to Aleph containers. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 
namespace  Aleph::const_iterator_detail
 

Concepts

concept  AlephRandomAccessItor
 Detects Aleph iterators that opted in to random-access promotion.
 

Typedefs

template<class R >
using Aleph::const_iterator_detail::const_item_t = typename const_item< std::remove_cv_t< R > >::type
 
template<class C >
using Aleph::const_iterator_t = Const_Iterator< typename C::Iterator >
 The read-only iterator of the container C.
 

Functions

template<class C >
requires (not std::is_const_v<C>)
auto Aleph::iterator_for (C &c)
 Iterator on c positioned on its first item: the container's own iterator on a modifiable container.
 
template<class C >
auto Aleph::iterator_for (const C &c)
 Iterator on c positioned on its first item: the read-only view on a constant container.
 
template<class Container >
Aleph::DynList< typename Container::value_type > extract_from_stl_container (const Container &c)
 Extract all items from an STL container into an Aleph DynList.
 

Detailed Description

STL-compatible iterator adapters for Aleph containers.

Provides StlIterator and StlConstIterator that wrap Aleph container iterators to satisfy std::input_iterator and std::forward_iterator concepts, enabling use with std::ranges and STL algorithms. Iterators that opt in via the aleph_random_access_iterator marker (see AlephRandomAccessItor) are promoted to std::random_access_iterator.

Author
Leandro Rabindranath León

Definition in file ah-iterator.H.

Function Documentation

◆ extract_from_stl_container()

template<class Container >
Aleph::DynList< typename Container::value_type > extract_from_stl_container ( const Container &  c)
inline

Extract all items from an STL container into an Aleph DynList.

Template Parameters
ContainerAny STL-like container supporting range-for iteration.
Parameters
cSource container.
Returns
A DynList containing copies of all elements from c.

Definition at line 853 of file ah-iterator.H.

References Aleph::DynList< T >::append().