Evo C++ Library v0.5.1
Public Types | Static Public Member Functions | List of all members
DataCompare< T, B1, B2 > Struct Template Reference

#include <evo/impl/container.h>

Inheritance diagram for DataCompare< T, B1, B2 >:
Inheritance graph
[legend]

Detailed Description

template<class T, bool B1 = IsPodType<T>::value, bool B2 = sizeof(T) == 1>
struct evo::DataCompare< T, B1, B2 >

Data comparison helpers.

Template Parameters
TData type to compare – must be either a POD type or implement int compare(const T& item) const
B1Inferred from T
B2Inferred from T

Public Types

typedef RemoveConst< T >::Type Item
 Item type (const removed) More...
 

Static Public Member Functions

static int compare (const T *data1, ulong size1, const T *data2, ulong size2)
 Compare data. More...
 
static int compare (const T &item1, const T &item2)
 Compare items. More...
 

Member Typedef Documentation

◆ Item

typedef RemoveConst<T>::Type Item
inherited

Item type (const removed)

Member Function Documentation

◆ compare() [1/2]

static int compare ( const T *  data1,
ulong  size1,
const T *  data2,
ulong  size2 
)
inlinestatic

Compare data.

  • This compares POD types directly, or calls T compare() method for non-POD types
Parameters
data1Data to compare
size1Data size to compare as item count
data2Data to compare to
size2Data size to compare to as item count
Returns
Result (<0 if data1 is less, 0 if equal, >0 if data1 is greater)

◆ compare() [2/2]

static int compare ( const T &  item1,
const T &  item2 
)
inlinestatic

Compare items.

  • This compares POD types directly, or calls T compare() method for non-POD types
Parameters
item1Item1 to compare
item2Item2 to compare
Returns
Result (<0 if item1 is less, 0 if equal, >0 if item1 is greater)

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