|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
CRTP Mixin providing element location operations. More...
#include <ah-dry-mixin.H>
Public Member Functions | |
| Type & | nth (const size_t n) const |
| Access the n-th element (bounds-checked). | |
| Type & | nth_ne (const size_t n) const noexcept |
| Access the n-th element (unchecked). | |
| template<class Operation > requires PredicateWith<Operation &, Type &> | |
| Type * | find_ptr (Operation &operation) |
| Find the first element satisfying a predicate. | |
| template<class Operation > requires PredicateWith<Operation &, Type &> | |
| Type * | find_ptr (Operation &operation) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<class Operation > requires PredicateWith<Operation &, Type &> | |
| Type * | find_ptr (Operation and operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<class Operation > requires PredicateWith<Operation &, Type &> | |
| Type * | find_ptr (Operation and operation=Operation()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<class Operation > requires PredicateWith<Operation &, Type &> | |
| std::tuple< bool, Type > | find_item (Operation &operation) |
| Find element with success flag. | |
| template<class Operation > requires PredicateWith<Operation &, Type &> | |
| std::tuple< bool, Type > | find_item (Operation &operation) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<class Operation > requires PredicateWith<Operation &, Type &> | |
| std::tuple< bool, Type > | find_item (Operation &&operation=Operation()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<class Operation > requires PredicateWith<Operation &, Type &> | |
| std::tuple< bool, Type > | find_item (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Protected Member Functions | |
| const Derived & | self () const noexcept |
| Derived & | self () noexcept |
CRTP Mixin providing element location operations.
This mixin adds methods to find and locate elements within a container:
nth() / nth_ne() - access element by indexfind_ptr() - find element matching a predicatefind_item() - find with success flag| Derived | The derived container class (CRTP pattern). |
| Type | The element type stored in the container. |
traverse() method (typically via TraverseMixin).Definition at line 227 of file ah-dry-mixin.H.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 428 of file ah-dry-mixin.H.
References Aleph::blossom_maximum_cardinality_matching(), and Aleph::LocateMixin< Derived, Type >::find_item().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 436 of file ah-dry-mixin.H.
References Aleph::blossom_maximum_cardinality_matching(), and Aleph::LocateMixin< Derived, Type >::find_item().
|
inline |
Find element with success flag.
Like find_ptr() but returns a tuple containing:
| Operation | Callable with signature bool(const Type&). |
| operation | Predicate to test each element. |
Definition at line 410 of file ah-dry-mixin.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::LocateMixin< Derived, Type >::find_ptr(), and Aleph::Type.
Referenced by Aleph::LocateMixin< Derived, Type >::find_item(), Aleph::LocateMixin< Derived, Type >::find_item(), and TEST().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 419 of file ah-dry-mixin.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::LocateMixin< Derived, Type >::find_ptr(), and Aleph::Type.
|
inline |
Find the first element satisfying a predicate.
Searches for the first element where the operation returns true.
| Operation | Callable with signature bool(Type&) or bool(const Type&). |
| operation | Predicate to test each element. |
Definition at line 333 of file ah-dry-mixin.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::LocateMixin< Derived, Type >::self(), and Aleph::Type.
Referenced by Aleph::LocateMixin< Derived, Type >::find_item(), Aleph::LocateMixin< Derived, Type >::find_item(), TEST(), and TEST().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Const version.
Definition at line 352 of file ah-dry-mixin.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::LocateMixin< Derived, Type >::self(), and Aleph::Type.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 379 of file ah-dry-mixin.H.
References Aleph::blossom_maximum_cardinality_matching().
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Version accepting rvalue operation.
Definition at line 371 of file ah-dry-mixin.H.
References Aleph::blossom_maximum_cardinality_matching().
|
inline |
Access the n-th element (bounds-checked).
Returns a reference to the element at position n (0-indexed).
| n | Zero-based index of the element. |
| std::out_of_range | if n >= size(). |
Definition at line 261 of file ah-dry-mixin.H.
References ah_out_of_range_error_if, Aleph::LocateMixin< Derived, Type >::self(), and Aleph::Type.
|
inlinenoexcept |
Access the n-th element (unchecked).
Returns a reference to the element at position n without bounds checking.
| n | Zero-based index of the element. |
Definition at line 292 of file ah-dry-mixin.H.
References Aleph::LocateMixin< Derived, Type >::self(), and Aleph::Type.
Referenced by TEST().
|
inlineprotectednoexcept |
Definition at line 230 of file ah-dry-mixin.H.
References Aleph::blossom_maximum_cardinality_matching().
Referenced by Aleph::LocateMixin< Derived, Type >::find_ptr(), Aleph::LocateMixin< Derived, Type >::find_ptr(), Aleph::LocateMixin< Derived, Type >::nth(), and Aleph::LocateMixin< Derived, Type >::nth_ne().
|
inlineprotectednoexcept |
Definition at line 235 of file ah-dry-mixin.H.
References Aleph::blossom_maximum_cardinality_matching().