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

Iterator traits and STL-compatible iterator wrappers. More...

#include <type_traits>
Include dependency graph for ahIterator.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Aleph::iterator_traits< Itor >
 Iterator traits for Aleph-w iterators. More...
 
struct  Aleph::__iterator< Set_Type >
 STL-compatible mutable iterator wrapper. More...
 
struct  Aleph::__const_iterator< Set_Type >
 STL-compatible const iterator wrapper. More...
 

Namespaces

namespace  Aleph
 Main namespace for Aleph-w library functions.
 

Macros

#define STL_ITOR_SPEC(It_Name)
 
#define STL_ALEPH_ITERATOR(Set_Name)
 

Detailed Description

Iterator traits and STL-compatible iterator wrappers.

This file provides iterator infrastructure for Aleph-w containers, enabling compatibility with STL algorithms and C++20 ranges.

Features

  • iterator_traits<Itor>: Type traits for iterators
  • __iterator<Set>: Mutable STL-compatible iterator wrapper
  • __const_iterator<Set>: Const STL-compatible iterator wrapper
  • STL_ALEPH_ITERATOR: Macro to add begin/end to containers

Usage Example

// Container uses macro to get STL interface
class MyContainer {
using Iterator = ...;
STL_ALEPH_ITERATOR(MyContainer);
};
// Now works with range-for and STL algorithms
MyContainer c;
for (auto& item : c) { ... }
std::find(c.begin(), c.end(), value);
#define STL_ALEPH_ITERATOR(Set_Name)
Definition ahIterator.H:208

C++20 Ranges Compatibility

The iterators satisfy std::input_iterator requirements:

  • operator* is const (required for std::indirectly_readable)
  • Proper == and != operators
  • Prefix and postfix ++
See also
ah-ranges.H C++20 ranges support
Author
Leandro Rabindranath León

Definition in file ahIterator.H.

Macro Definition Documentation

◆ STL_ALEPH_ITERATOR

#define STL_ALEPH_ITERATOR (   Set_Name)

Definition at line 208 of file ahIterator.H.

◆ STL_ITOR_SPEC

#define STL_ITOR_SPEC (   It_Name)

Definition at line 99 of file ahIterator.H.