|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Equality test for sets. More...
#include <ah-dry.H>
Public Member Functions | |
| template<class C = Container> requires Aleph::dry_detail::SetSearchable<C> | |
| bool | equal_to (const Container &r) const |
Test if elements of this are exactly contained in another container. | |
Private Member Functions | |
| const Container * | const_me () const noexcept |
Friends | |
| template<class C = Container> requires Aleph::dry_detail::SetSearchable<C> | |
| bool | operator== (const Container &l, const Container &r) |
Equality operator: l.equal_to(r). | |
| template<class C = Container> requires Aleph::dry_detail::SetSearchable<C> | |
| bool | operator!= (const Container &l, const Container &r) |
| Negation of equal_to() | |
Equality test for sets.
The test compares the sizes and then searches each element of this in the other container with search(). That is the equality of sets only: it ignores the order and the repetitions, so it is offered only to containers that have Key_Type and search(), and is meant for containers that keep no repeated keys, such as hash tables.
Sequences use EqualSequenceMethod, and sorted containers that may keep repeated keys use EqualSortedMethod.
|
inlineprivatenoexcept |
Definition at line 3027 of file ah-dry.H.
Referenced by EqualToMethod< Container >::equal_to().
|
inline |
Test if elements of this are exactly contained in another container.
This method serves for testing if two containers contain the same elements. First, the container sizes are tested for equality. If they have the same size, then the testing is done by traversing this. Each seen element is searched in the another container with the method search().
| [in] | r | container on which the searches will be performed. |
true if the container have the same size and all the elements of this are present in r | anything | that size(), search() or the comparator or hash function of the container throws. |
Definition at line 3053 of file ah-dry.H.
References EqualToMethod< Container >::const_me(), k, and r.
|
friend |
Negation of equal_to()
| [in] | l | container to compare. |
| [in] | r | container to compare with. |
| what | equal_to() throws. |
|
friend |
Equality operator: l.equal_to(r).
A hidden friend with two parameters of the same type, so that the C++20 reversed candidate is never ambiguous; a template so that its constraint is checked on use (Clang 14 checks the constraint of a non-template member when the class is instantiated).
| [in] | l | container to compare. |
| [in] | r | container to compare with. |
| what | equal_to() throws. |