Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::uni_zip_detail::StlIteratorWrapper< Container > Class Template Reference

Wrapper that provides a uniform interface for STL iterators. More...

#include <ah-zip-utils.H>

Public Types

using value_type = typename std::decay_t< Container >::value_type
 

Public Member Functions

 StlIteratorWrapper (const Container &c)
 Constructor initializing from container.
 
bool has_curr () const noexcept
 Check if iterator has a current element.
 
bool completed () const noexcept
 Check if iterator has reached the end.
 
auto get_curr () const
 Get the current element.
 
void next () noexcept
 Advance to the next element.
 
void next_ne () noexcept
 Advance without checking; same as next(), which does not check.
 

Private Attributes

std::decay_t< Container >::const_iterator curr_
 
std::decay_t< Container >::const_iterator end_
 

Detailed Description

template<typename Container>
class Aleph::uni_zip_detail::StlIteratorWrapper< Container >

Wrapper that provides a uniform interface for STL iterators.

This wrapper adapts STL-style iterators (begin(), end(), operator++, operator*) to the Aleph-style iterator interface (has_curr(), get_curr(), next(), etc.).

Template Parameters
ContainerThe type of the STL-compatible container.
Author
Leandro Rabindranath Leon

Definition at line 150 of file ah-zip-utils.H.

Member Typedef Documentation

◆ value_type

template<typename Container >
using Aleph::uni_zip_detail::StlIteratorWrapper< Container >::value_type = typename std::decay_t<Container>::value_type

Definition at line 156 of file ah-zip-utils.H.

Constructor & Destructor Documentation

◆ StlIteratorWrapper()

template<typename Container >
Aleph::uni_zip_detail::StlIteratorWrapper< Container >::StlIteratorWrapper ( const Container &  c)
inlineexplicit

Constructor initializing from container.

Definition at line 159 of file ah-zip-utils.H.

Member Function Documentation

◆ completed()

template<typename Container >
bool Aleph::uni_zip_detail::StlIteratorWrapper< Container >::completed ( ) const
inlinenoexcept

◆ get_curr()

template<typename Container >
auto Aleph::uni_zip_detail::StlIteratorWrapper< Container >::get_curr ( ) const
inline

Get the current element.

Get the current element

Definition at line 175 of file ah-zip-utils.H.

References Aleph::uni_zip_detail::StlIteratorWrapper< Container >::curr_.

◆ has_curr()

template<typename Container >
bool Aleph::uni_zip_detail::StlIteratorWrapper< Container >::has_curr ( ) const
inlinenoexcept

◆ next()

template<typename Container >
void Aleph::uni_zip_detail::StlIteratorWrapper< Container >::next ( )
inlinenoexcept

Advance to the next element.

Advance to the next element

Advance all iterators

Definition at line 183 of file ah-zip-utils.H.

References Aleph::uni_zip_detail::StlIteratorWrapper< Container >::curr_.

Referenced by Aleph::uni_zip_detail::StlIteratorWrapper< Container >::next_ne().

◆ next_ne()

template<typename Container >
void Aleph::uni_zip_detail::StlIteratorWrapper< Container >::next_ne ( )
inlinenoexcept

Advance without checking; same as next(), which does not check.

Provided so the adaptor satisfies AlephIterator and works in generic code that advances with next_ne() under a has_curr() guard.

Definition at line 193 of file ah-zip-utils.H.

References Aleph::uni_zip_detail::StlIteratorWrapper< Container >::next().

Member Data Documentation

◆ curr_

◆ end_


The documentation for this class was generated from the following file: