Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Inversed_Compare< T, Compare > Class Template Reference

Performs order reversal of Compare by swapping operands. More...

#include <ahFunction.H>

Public Member Functions

constexpr Inversed_Compare (const Compare &__cmp) noexcept
 The inversion of __cmp, which is not copied.
 
 Inversed_Compare (Compare &&cmp=Compare()) noexcept
 
constexpr bool operator() (const T &op1, const T &op2) const noexcept(noexcept(static_cast< bool >(cmp(op2, op1))))
 

Private Attributes

const Compare & cmp
 

Detailed Description

template<class T, class Compare>
class Aleph::Inversed_Compare< T, Compare >

Performs order reversal of Compare by swapping operands.

Inversed_Compare evaluates cmp(op2, op1). This is a semantic inversion (argument swap), not logical negation of cmp(op1, op2). For example: < becomes >, and <= becomes >=.

Template Parameters
TType of values to compare
CompareComparison functor type

Definition at line 1152 of file ahFunction.H.

Constructor & Destructor Documentation

◆ Inversed_Compare() [1/2]

template<class T , class Compare >
constexpr Aleph::Inversed_Compare< T, Compare >::Inversed_Compare ( const Compare &  __cmp)
inlineconstexprnoexcept

The inversion of __cmp, which is not copied.

Parameters
[in]__cmpthe comparison. The object keeps a reference to it: __cmp must outlive the object.

Definition at line 1163 of file ahFunction.H.

◆ Inversed_Compare() [2/2]

template<class T , class Compare >
Aleph::Inversed_Compare< T, Compare >::Inversed_Compare ( Compare &&  cmp = Compare())
inlinenoexcept

Definition at line 1165 of file ahFunction.H.

Member Function Documentation

◆ operator()()

template<class T , class Compare >
constexpr bool Aleph::Inversed_Compare< T, Compare >::operator() ( const T &  op1,
const T &  op2 
) const
inlineconstexprnoexcept

Definition at line 1172 of file ahFunction.H.

References Aleph::Inversed_Compare< T, Compare >::cmp.

Member Data Documentation

◆ cmp

template<class T , class Compare >
const Compare& Aleph::Inversed_Compare< T, Compare >::cmp
private

Definition at line 1154 of file ahFunction.H.

Referenced by Aleph::Inversed_Compare< T, Compare >::operator()().


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