Aleph-w  1.9
General library for algorithms and data structures
Aleph::EqualToMethod< Container > Class Template Reference

#include <htlist.H>

Public Member Functions

bool equal_to (const Container &r) const noexcept
 
bool operator== (const Container &r) const noexcept
 
bool operator!= (const Container &r) const noexcept
 Negation of are_equal()
 

Detailed Description

template<class Container>
class Aleph::EqualToMethod< Container >

Equality test for containers.

Member Function Documentation

◆ equal_to()

template<class Container>
bool Aleph::EqualToMethod< Container >::equal_to ( const Container &  r) const
inlinenoexcept

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(). So the container r must export the search() method, which frequently is the case for containers oriented to fast retrieval.

Warning
On some container, concretely DynList, the size is computed, not retrieved. So take in account this fact.
Parameters
[in]rcontainer on which the searches will be performed.
Returns
true if the container have the same size and all the elements of this are present in r

◆ operator==()

template<class Container>
bool Aleph::EqualToMethod< Container >::operator== ( const Container &  r) const
inlinenoexcept

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.


The documentation for this class was generated from the following file:

Leandro Rabindranath León