Elm  1.0
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
elm::Comparator< T > Class Template Reference

#include <elm/compare.h>

Public Member Functions

int doCompare (const T &v1, const T &v2) const
 

Static Public Member Functions

static int compare (const T &v1, const T &v2)
 

Detailed Description

template<class T>
class elm::Comparator< T >

Comparator concept (elm/compare.h) allows comparing two data. Comparator may be used statically with the compare() method but also as in instance with doCompare() method. As a default, doCompare() performs a call to compare().

Several implementation of Comparator concept exists:

Member Function Documentation

template<class T >
int elm::Comparator< T >::compare ( const T &  v1,
const T &  v2 
)
static

Compare v1 and v2 and returns:

  • > 0 if v1 > v2
  • = 0 if v1 = v2
  • < 0 if v1 < v2
    Parameters
    v1First value.
    v2Second value
    Returns
    See above.

Referenced by elm::Comparator< T >::doCompare().

template<class T >
int elm::Comparator< T >::doCompare ( const T &  v1,
const T &  v2 
) const

Compare v1 and v2 and returns:

  • > 0 if v1 > v2
  • = 0 if v1 = v2
  • < 0 if v1 < v2
    Parameters
    v1First value.
    v2Second value
    Returns
    See above.

References elm::Comparator< T >::compare().


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