yat  0.10.4pre
Public Member Functions
theplu::yat::utility::pair_value_compare< T1, T2 > Struct Template Reference

Functor comparing pairs using second. More...

#include </scratch/bob/jari/tmp/pristine/yat-0.10.x/yat/utility/stl_utility.h>

List of all members.

Public Member Functions

bool operator() (const std::pair< T1, T2 > &x, const std::pair< T1, T2 > &y)

Detailed Description

template<class T1, class T2>
struct theplu::yat::utility::pair_value_compare< T1, T2 >

Functor comparing pairs using second.

STL provides operator< for the pair.first element, but none for pair.second. This template provides this and can be used as the comparison object in generic functions such as the STL sort.


Member Function Documentation

template<class T1 , class T2 >
bool theplu::yat::utility::pair_value_compare< T1, T2 >::operator() ( const std::pair< T1, T2 > &  x,
const std::pair< T1, T2 > &  y 
)
inline
Returns:
true if x.second<y.second or (!(y.second<y.second) and x.first<y.first)

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

Generated on Mon Nov 11 2013 09:41:46 for yat by  doxygen 1.8.1