P4C
The P4 Compiler
Loading...
Searching...
No Matches
PairLess< A, B, AComp, BCmp > Class Template Reference

#include <cmp.h>

Public Types

using Pair = std::pair<A, B>
 

Public Member Functions

bool operator() (const Pair &a, const Pair &b) const
 

Detailed Description

template<class A, class B, class AComp = std::less<A>, class BCmp = std::less<B>>
class PairLess< A, B, AComp, BCmp >

Lifts std::less, or user-specified comparer to std::pair<A, B> using lexicographical comparison. Comparers given in AComp, BComp must be stateless and default constructible. Comparers must produce total order, in particular it must hold that !(a < b) && !(b < a) => a == b.