fesa-core  5.0.1
fesa::Functors::CompareToReferenceOrder< T, InputIterator > Struct Template Reference

#include <Functors.h>

Public Member Functions

 CompareToReferenceOrder (InputIterator first, InputIterator last)
 
bool operator() (const T &lhs, const T &rhs) const
 

Detailed Description

template<class T, class InputIterator>
struct fesa::Functors::CompareToReferenceOrder< T, InputIterator >

Functor that compares objects to a reference ordering provided by two iterators. The objects in the range of the iterators must not be modified while this functor is used, otherwise results are unpredictable. InputIterator objects must be relationally comparable (i.e. operator< must be defined). Only random access iterators have this property.

Template Parameters
Tthe type of objects to be compared
InputIteratorthe type of the random access iterator that contains the reference order of objects.

Constructor & Destructor Documentation

template<class T , class InputIterator >
fesa::Functors::CompareToReferenceOrder< T, InputIterator >::CompareToReferenceOrder ( InputIterator  first,
InputIterator  last 
)
inline

Instantiates a CompareToReferenceOrder with the objects in the range [first, last).

Member Function Documentation

template<class T , class InputIterator >
bool fesa::Functors::CompareToReferenceOrder< T, InputIterator >::operator() ( const T &  lhs,
const T &  rhs 
) const
inline

Returns true if lhs is before rhs in the range [first_, last_).

Exceptions
std::runtime_errorif either lhs or rhs is not in [first_, last_)

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