|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Classes | |
| struct | inner_item |
Item type of a container returned by the operation of flat_map(): its Item_Type, or else its value_type. More... | |
| struct | inner_item< C > |
Item type of an Aleph container returned by the operation of flat_map(). More... | |
| struct | Modifying_Probe |
| Operation that needs to modify the item it receives. More... | |
| struct | Reading_Probe |
| Operation that only reads the item and never throws. More... | |
Concepts | |
| concept | MutablyTraversable |
The modifiable traversal of Container hands out T &. | |
| concept | SetSearchable |
Container can be compared as a set: it has size(), a Key_Type and a search() that returns a pointer. | |
| concept | FoldOperation |
op folds an accumulator Acc with an item T. | |
| concept | FoldRightOperation |
op folds an item T with an accumulator Acc from the right. | |
Functions | |
| template<class It > | |
| void | advance (It &it) noexcept(advance_is_noexcept< It >) |
| Advance an iterator that is positioned on an item. | |
| template<class It > | |
| decltype(auto) | current (It &it) noexcept(current_is_noexcept< It >) |
| Current item of an iterator that is positioned on one. | |
| template<class Acc , class Step > | |
| void | assign_fold (Acc &acc, Step &&step) |
Store in acc the result of a folding step step(). | |
| template<class Acc , class Op , class T > | |
| void | fold_left_step (Acc &acc, Op &op, const T &item) |
One step of a left fold: acc = op(acc, item). | |
| template<class Acc , class Op , class T > | |
| void | fold_right_step (Acc &acc, Op &op, const T &item) |
One step of a right fold: acc = op(item, acc). | |
Variables | |
| template<class Container , class T > | |
| constexpr bool | const_traversal_is_noexcept |
The constant traversal of Container cannot throw by itself. | |
| template<class Container , class T > | |
| constexpr bool | mutable_traversal_is_noexcept |
The modifiable traversal of Container cannot throw by itself. | |
| template<class It > | |
| constexpr bool | advance_is_noexcept |
| Advancing an iterator positioned on an item cannot throw. | |
| template<class It > | |
| constexpr bool | current_is_noexcept |
| Reading the current item of an iterator positioned on one cannot throw. | |
Advance an iterator that is positioned on an item.
Uses next_ne() when the iterator has it: the caller has already checked has_curr(), so the check of next() is redundant.
| [in,out] | it | iterator positioned on an item. |
Definition at line 214 of file ah-dry.H.
Referenced by EqualSequenceMethod< Container >::equal_to(), EqualSortedMethod< Container >::equal_to(), GenericTraverse< Container >::traverse(), and GenericTraverse< Container >::traverse().
| void Aleph::dry_detail::assign_fold | ( | Acc & | acc, |
| Step && | step | ||
| ) |
Store in acc the result of a folding step step().
If the step returns a reference, which may be to acc itself, the result is moved out first, so that acc is never assigned from itself.
| [in,out] | acc | the accumulator. |
| [in] | step | callable that runs the folding step. |
| anything | that step or the assignment of Acc throws. |
Definition at line 299 of file ah-dry.H.
References Aleph::next().
Referenced by fold_left_step(), and fold_right_step().
Current item of an iterator that is positioned on one.
Uses get_curr_ne() when the iterator has it: the caller has already checked has_curr().
| [in] | it | iterator positioned on an item. |
get_curr_ne(), or else get_curr(), returns. | anything | that get_curr() throws, if the iterator has no get_curr_ne(). |
Definition at line 233 of file ah-dry.H.
Referenced by EqualSequenceMethod< Container >::equal_to(), EqualSortedMethod< Container >::equal_to(), GenericTraverse< Container >::traverse(), and GenericTraverse< Container >::traverse().
| void Aleph::dry_detail::fold_left_step | ( | Acc & | acc, |
| Op & | op, | ||
| const T & | item | ||
| ) |
One step of a left fold: acc = op(acc, item).
The accumulator is moved into op when op accepts an rvalue, so that folding into a container costs O(1) per step instead of a copy of the whole accumulator, as std::accumulate does since C++20.
| [in,out] | acc | the accumulator. |
| [in] | op | the folding operation. |
| [in] | item | the current item. |
| anything | that op or the assignment of Acc throws. |
Definition at line 322 of file ah-dry.H.
References assign_fold().
Referenced by FunctionalMethods< Container, T >::foldl(), and FunctionalMethods< Container, T >::reduce().
| void Aleph::dry_detail::fold_right_step | ( | Acc & | acc, |
| Op & | op, | ||
| const T & | item | ||
| ) |
One step of a right fold: acc = op(item, acc).
| [in,out] | acc | the accumulator. |
| [in] | op | the folding operation. |
| [in] | item | the current item. |
| anything | that op or the assignment of Acc throws. |
Definition at line 338 of file ah-dry.H.
References assign_fold().
Referenced by FunctionalMethods< Container, T >::foldr().
|
inlineconstexpr |
Advancing an iterator positioned on an item cannot throw.
|
inlineconstexpr |
The constant traversal of Container cannot throw by itself.
True if traverse() on a constant container is noexcept when its operation is. A container whose traverse() has no noexcept specification is taken as possibly throwing.
| Container | the CRTP-derived container. |
| T | item type. |
|
inlineconstexpr |
Reading the current item of an iterator positioned on one cannot throw.
|
inlineconstexpr |