CoMMA 1.3.2
A geometric agglomerator for unstructured meshes
Loading...
Searching...
No Matches
comma::Priority_Pair< A, B > Class Template Reference

Wrapper around the STL pair with custom 'less than' operator: as in the standard case, first we compare the first elements, then the second ones; however it relies on the 'greater than' on the first elements, e.g., (4,X) < (3,Y), whereas standard rules apply to second elements, e.g., (4,3) < (4,4). More...

#include <Priority_Pair.h>

Public Member Functions

 Priority_Pair ()=default
 Constructor. More...
 
 Priority_Pair (const A &a, const B &b)
 Constructor. More...
 
 ~Priority_Pair ()=default
 Destructor. More...
 
first () const
 Accessor to the first element. More...
 
second () const
 Accessor to the first element. More...
 

Friends

bool operator< (const Priority_Pair &a, const Priority_Pair &b)
 Operator 'less than'. It actually relies on the 'greater than' operator for the first elements and 'less than' for the second ones. More...
 
bool operator== (const Priority_Pair &a, const Priority_Pair &b)
 Operator 'equal'. More...
 

Detailed Description

template<typename A, typename B>
class comma::Priority_Pair< A, B >

Wrapper around the STL pair with custom 'less than' operator: as in the standard case, first we compare the first elements, then the second ones; however it relies on the 'greater than' on the first elements, e.g., (4,X) < (3,Y), whereas standard rules apply to second elements, e.g., (4,3) < (4,4).

Template Parameters
AType of the first element of the pair
BType of the second element of the pair

Constructor & Destructor Documentation

◆ Priority_Pair() [1/2]

template<typename A , typename B >
comma::Priority_Pair< A, B >::Priority_Pair ( )
default

Constructor.

◆ Priority_Pair() [2/2]

template<typename A , typename B >
comma::Priority_Pair< A, B >::Priority_Pair ( const A &  a,
const B &  b 
)
inline

Constructor.

Parameters
aFirst element
bSecond element

◆ ~Priority_Pair()

template<typename A , typename B >
comma::Priority_Pair< A, B >::~Priority_Pair ( )
default

Destructor.

Member Function Documentation

◆ first()

template<typename A , typename B >
A comma::Priority_Pair< A, B >::first ( ) const
inline

Accessor to the first element.

Returns
The first element

◆ second()

template<typename A , typename B >
B comma::Priority_Pair< A, B >::second ( ) const
inline

Accessor to the first element.

Returns
The second element

Friends And Related Function Documentation

◆ operator<

template<typename A , typename B >
bool operator< ( const Priority_Pair< A, B > &  a,
const Priority_Pair< A, B > &  b 
)
friend

Operator 'less than'. It actually relies on the 'greater than' operator for the first elements and 'less than' for the second ones.

Parameters
aFirst pair
bSecond pair
Returns
true if a.first > b.first or (a.first == b.first and a.second < b.second); false otherwise

◆ operator==

template<typename A , typename B >
bool operator== ( const Priority_Pair< A, B > &  a,
const Priority_Pair< A, B > &  b 
)
friend

Operator 'equal'.

Parameters
aFirst pair
bSecond pair
Returns
true if a and b are equal

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