Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
AssocComparator< K, T, C > Class Template Reference

#include <elm/compare.h>

+ Inheritance diagram for AssocComparator< K, T, C >:

Public Types

typedef Pair< K, T > pair_t
 
typedef pair_t t
 
- Public Types inherited from Comparator< K >
typedef K t
 

Public Member Functions

 AssocComparator (const C &c=single< C >())
 
int doCompare (const pair_t &v1, const pair_t &v2) const
 
int compareKey (const K &k1, const K &k2) const
 
- Public Member Functions inherited from Comparator< K >
int doCompare (const K &v1, const K &v2) const
 

Static Public Member Functions

static int compare (const pair_t &v1, const pair_t &v2)
 
- Static Public Member Functions inherited from Comparator< K >
static int compare (const K &v1, const K &v2)
 

Detailed Description

template<class K, class T, class C = Comparator<K>>
class elm::AssocComparator< K, T, C >

An associative comparator may be used to transform an ordered data structure into a map. If the items of ordered data structure are represented as pair of (key, values), this comparator provides comparison of items based on the key member.

This class is also the default comparator of pairs.

Parameters
KKey type.
TValue type.
CComparator for the key.

Member Typedef Documentation

◆ pair_t

typedef Pair<K, T> pair_t

◆ t

typedef pair_t t

Constructor & Destructor Documentation

◆ AssocComparator()

AssocComparator ( const C &  c = single<C>())
inline

Member Function Documentation

◆ compare()

static int compare ( const pair_t v1,
const pair_t v2 
)
inlinestatic

◆ compareKey()

int compareKey ( const K &  k1,
const K &  k2 
) const
inline

◆ doCompare()

int doCompare ( const pair_t v1,
const pair_t v2 
) const
inline

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