Add hasher and comparator for StringIdx.

This commit is contained in:
Bartosz Taudul 2021-07-11 19:43:40 +02:00
parent d6835f3a7a
commit b6db644ac6
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -95,6 +95,22 @@ private:
uint8_t m_idx[3];
};
struct StringIdxHasher
{
size_t operator()( const StringIdx& key ) const
{
return charutil::hash( (const char*)&key, sizeof( StringIdx ) );
}
};
struct StringIdxComparator
{
bool operator()( const StringIdx& lhs, const StringIdx& rhs ) const
{
return memcmp( &lhs, &rhs, sizeof( StringIdx ) ) == 0;
}
};
class Int24
{
public: