lestes::std::pair_comparator< T, ComparatorFirst, ComparatorSecond > Class Template Reference

#include <pair_comparator.hh>

List of all members.

Public Types

typedef ComparatorFirst< typename
T::pointee_type::first_type > 
comparator_first
typedef ComparatorSecond<
typename T::pointee_type::second_type > 
comparator_second

Public Member Functions

bool operator() (const T &a, const T &b) const
 compares lexicographically a pair

template<typename T, template< typename U > class ComparatorFirst = ::std::less, template< typename U > class ComparatorSecond = ComparatorFirst>
class lestes::std::pair_comparator< T, ComparatorFirst, ComparatorSecond >


Member Typedef Documentation

template<typename T, template< typename U > class ComparatorFirst = ::std::less, template< typename U > class ComparatorSecond = ComparatorFirst>
typedef ComparatorFirst< typename T::pointee_type::first_type > lestes::std::pair_comparator< T, ComparatorFirst, ComparatorSecond >::comparator_first

template<typename T, template< typename U > class ComparatorFirst = ::std::less, template< typename U > class ComparatorSecond = ComparatorFirst>
typedef ComparatorSecond< typename T::pointee_type::second_type > lestes::std::pair_comparator< T, ComparatorFirst, ComparatorSecond >::comparator_second


Member Function Documentation

template<typename T, template< typename U > class ComparatorFirst = ::std::less, template< typename U > class ComparatorSecond = ComparatorFirst>
bool lestes::std::pair_comparator< T, ComparatorFirst, ComparatorSecond >::operator() ( const T &  a,
const T &  b 
) const [inline]

compares lexicographically a pair

The inner workings determine the ordering by examining first the first part of the pair. If the first pair's first element is strictly less (where less is the relation of ComparatorFirst) than the second's, the whole first pair is less (the relation imposed by this comparator) than the second. If however the second's first is less than the first's, the first pair is not less than second. In the remaining case, i.e. neither first's first nor second's first is less than the other, the relation on the pair is determined solely by ComparatorSecond on the seconds of both pairs.


The documentation for this class was generated from the following file:
Generated on Mon Feb 12 18:50:05 2007 for lestes by doxygen 1.5.1-20070107