System::Collections::Generic::EqualityComparerHashAdapter< T > Struct Template Reference

Public Member Functions

 EqualityComparerHashAdapter ()
 Creates adapter with no comparator to use. More...
 
 EqualityComparerHashAdapter (const SharedPtr< IEqualityComparer< T >> &comparator)
 
void set_EqualityComparator (const SharedPtr< IEqualityComparer< T >> &comparator)
 
std::size_t operator() (const T &x) const
 

Detailed Description

template<typename T>
struct System::Collections::Generic::EqualityComparerHashAdapter< T >

Adapter to use IEqualityComparer for hashing. Uses comparator object, if set; otherwise, uses available hash method selected using DictionaryHashSelector struct.

Template Parameters
Hashedtype.

Constructor & Destructor Documentation

◆ EqualityComparerHashAdapter() [1/2]

Creates adapter with no comparator to use.

◆ EqualityComparerHashAdapter() [2/2]

Creates adapter with given comparator to use.

Parameters
comparatorComparator to use.

Member Function Documentation

◆ operator()()

template<typename T >
std::size_t System::Collections::Generic::EqualityComparerHashAdapter< T >::operator() ( const T &  x) const
inline

Calculates hash value.

Parameters
xHashed object.
Returns
Calculated hash value.

◆ set_EqualityComparator()

template<typename T >
void System::Collections::Generic::EqualityComparerHashAdapter< T >::set_EqualityComparator ( const SharedPtr< IEqualityComparer< T >> &  comparator)
inline

Sets comparator to use.

Parameters
comparatorComparator to use.