|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Iterator and container validation utilities. More...
Go to the source code of this file.
Namespaces | |
| namespace | Aleph |
| Main namespace for Aleph-w library functions. | |
Functions | |
| template<typename Container , typename Iterator > | |
| void | Aleph::verify_container_and_iterator (const Container &container, const Iterator &itor) |
| Verifies that an iterator belongs to a specific container. | |
| template<typename Iterator > | |
| void | Aleph::verify_iterators (const Iterator &itor1, const Iterator &itor2) |
| Verifies that two iterators belong to the same container. | |
| template<typename Container , typename Iterator > | |
| void | Aleph::verify_container_and_iterators (const Container &container, const Iterator &itor_container, const Iterator &itor1, const Iterator &itor2) |
| Verifies container-iterator relationships with distinctness check. | |
| template<typename Container , typename Iterator > | |
| void | Aleph::verify_container_and_iterators (const Container &container, const Iterator &itor1, const Iterator &itor2) |
| Verifies that two iterators both belong to a specific container. | |
Iterator and container validation utilities.
This header provides utility functions for validating that iterators belong to specific containers. These are useful for debugging and for implementing robust container operations.
When working with STL-style iterators, it's often necessary to verify that an iterator is valid for a particular container before performing operations. These utilities provide a consistent way to perform such checks and throw appropriate exceptions on failure.
The iterators used with these functions must provide a verify() method:
bool verify(const Container&) - returns true if iterator belongs to containerbool verify(const Iterator&) - returns true if both iterators belong to same containerDefinition in file ah_stdc++_utils.H.