|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Default comparator for pair types in hash maps. More...
#include <ahDry.H>
Public Member Functions | |
| Dft_Pair_Cmp () noexcept(std::is_nothrow_default_constructible_v< Cmp >) | |
| Builds the comparator of the keys by default. | |
| Dft_Pair_Cmp (Cmp __cmp) noexcept(std::is_nothrow_constructible_v< Cmp, Cmp & >) | |
Wraps the comparator __cmp of the keys. | |
| bool | operator() (const std::pair< Key, Data > &p1, const std::pair< Key, Data > &p2) const noexcept(std::is_nothrow_invocable_r_v< bool, const Cmp &, const Key &, const Key & >) |
Pair vs Pair comparison; it throws what cmp throws. | |
| bool | operator() (const std::pair< Key, Data > &p, const Key &k) const noexcept(std::is_nothrow_invocable_r_v< bool, const Cmp &, const Key &, const Key & >) |
Heterogeneous: Pair vs Key; it throws what cmp throws. | |
| bool | operator() (const Key &k, const std::pair< Key, Data > &p) const noexcept(std::is_nothrow_invocable_r_v< bool, const Cmp &, const Key &, const Key & >) |
Heterogeneous: Key vs Pair; it throws what cmp throws. | |
Public Attributes | |
| Cmp | cmp |
Default comparator for pair types in hash maps.
Wraps a key comparator to work with std::pair<Key, Data>. Supports heterogeneous comparison (Pair vs Key).
Its comparisons are noexcept only if those of Cmp are, with the conversion of their result to bool, so that a map whose comparison throws lets the exception reach its caller.
| Key | Key type |
| Data | Data type |
| Cmp | Key comparator (default: std::equal_to<Key>) |
|
inlinenoexcept |
Builds the comparator of the keys by default.
It is a constructor apart from the one that takes the comparator, and not a default argument of that one: GCC and Clang do not count a default argument in the noexcept of the implicit default constructor of a class that holds or inherits this one, and what that argument threw would end the program there.
| What | the default construction of Cmp throws; nothing when it is noexcept, so that a map whose comparator has no state is built without throwing, and its tree too. |
|
inlinenoexcept |
|
inlinenoexcept |
Heterogeneous: Key vs Pair; it throws what cmp throws.
Definition at line 253 of file ahDry.H.
References Aleph::Dft_Pair_Cmp< Key, Data, Cmp >::cmp, and k.
|
inlinenoexcept |
Heterogeneous: Pair vs Key; it throws what cmp throws.
Definition at line 244 of file ahDry.H.
References Aleph::Dft_Pair_Cmp< Key, Data, Cmp >::cmp, and k.
|
inlinenoexcept |
Pair vs Pair comparison; it throws what cmp throws.
Definition at line 235 of file ahDry.H.
References Aleph::Dft_Pair_Cmp< Key, Data, Cmp >::cmp.
| Cmp Aleph::Dft_Pair_Cmp< Key, Data, Cmp >::cmp |
Definition at line 207 of file ahDry.H.
Referenced by Aleph::Dft_Pair_Cmp< Key, Data, Cmp >::operator()(), Aleph::Dft_Pair_Cmp< Key, Data, Cmp >::operator()(), and Aleph::Dft_Pair_Cmp< Key, Data, Cmp >::operator()().