adding std::hash support for fc::array
This commit is contained in:
parent
87542eba25
commit
0956cd26df
2 changed files with 19 additions and 1 deletions
|
|
@ -92,8 +92,9 @@ set( fc_sources
|
|||
src/crypto/crc.cpp
|
||||
src/crypto/city.cpp
|
||||
src/crypto/base32.cpp
|
||||
src/crypto/base64.cpp
|
||||
src/crypto/base36.cpp
|
||||
src/crypto/base58.cpp
|
||||
src/crypto/base64.cpp
|
||||
src/crypto/bigint.cpp
|
||||
src/crypto/hex.cpp
|
||||
src/crypto/sha1.cpp
|
||||
|
|
|
|||
|
|
@ -53,4 +53,21 @@ namespace fc {
|
|||
else
|
||||
memset( &bi, char(0), sizeof(bi) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#include <fc/crypto/city.hpp>
|
||||
namespace std
|
||||
{
|
||||
template<typename T> struct hash;
|
||||
|
||||
template<typename T, size_t N>
|
||||
struct hash<fc::array<T,N> >
|
||||
{
|
||||
size_t operator()( const fc::array<T,N>& e )const
|
||||
{
|
||||
return fc::city_hash64( (char*)&e, sizeof(e) );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue