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>
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
-
A | Type of the first element of the pair |
B | Type of the second element of the pair |
◆ Priority_Pair() [1/2]
template<typename A , typename B >
◆ Priority_Pair() [2/2]
template<typename A , typename B >
Constructor.
- Parameters
-
a | First element |
b | Second element |
◆ ~Priority_Pair()
template<typename A , typename B >
◆ first()
template<typename A , typename B >
Accessor to the first element.
- Returns
- The first element
◆ second()
template<typename A , typename B >
Accessor to the first element.
- Returns
- The second element
◆ operator<
template<typename A , typename B >
Operator 'less than'. It actually relies on the 'greater than' operator for the first elements and 'less than' for the second ones.
- Parameters
-
- 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 >
Operator 'equal'.
- Parameters
-
- Returns
- true if a and b are equal
The documentation for this class was generated from the following file: