Evo C++ Library v0.5.1
Public Types | Public Member Functions | List of all members
CompareHash< T > Struct Template Reference

#include <evo/impl/container.h>

Inheritance diagram for CompareHash< T >:
Inheritance graph
[legend]

Detailed Description

template<class T>
struct evo::CompareHash< T >

Hash object used with containers that hash items.

Template Parameters
TType to hash

Public Types

typedef Compare< T > CompareBase
 Base compare type. More...
 
typedef RemoveConst< T >::Type Item
 Item type (const removed) More...
 
typedef DataCopy< T >::PassType PassItem
 Best type for passing Item, either const Item& (by reference) or Item (by value) for POD types. More...
 

Public Member Functions

ulong hash (PassItem key, ulong seed=0) const
 Hash function method. More...
 
int operator() (PassItem a, PassItem b) const
 Comparison method. More...
 

Member Typedef Documentation

◆ CompareBase

typedef Compare<T> CompareBase

Base compare type.

◆ Item

typedef RemoveConst<T>::Type Item
inherited

Item type (const removed)

◆ PassItem

typedef DataCopy<T>::PassType PassItem
inherited

Best type for passing Item, either const Item& (by reference) or Item (by value) for POD types.

Member Function Documentation

◆ hash()

ulong hash ( PassItem  key,
ulong  seed = 0 
) const
inline

Hash function method.

Parameters
keyKey to hash
seedSeed to start with, 0 for none, or can be from hashing another value
Returns
Hash function result

◆ operator()()

int operator() ( PassItem  a,
PassItem  b 
) const
inlinevirtualinherited

Comparison method.

Parameters
aItem a to compare (left side)
bItem b to compare (right side)
Returns
Comparison result: 0:equal, negative:(a < b), positive:(a > b)

Implements CompareBase< T >.


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