Go to the documentation of this file. 38 #define CRYPTO_MAKE_COMPARABLE(type) \ 40 inline bool operator==(const type &_v1, const type &_v2) { \ 41 return std::memcmp(&_v1, &_v2, sizeof(type)) == 0; \ 43 inline bool operator!=(const type &_v1, const type &_v2) { \ 44 return std::memcmp(&_v1, &_v2, sizeof(type)) != 0; \ 48 #define CRYPTO_MAKE_HASHABLE(type) \ 49 CRYPTO_MAKE_COMPARABLE(type) \ 51 static_assert(sizeof(std::size_t) <= sizeof(type), "Size of " #type " must be at least that of size_t"); \ 52 inline std::size_t hash_value(const type &_v) { \ 53 return reinterpret_cast<const std::size_t &>(_v); \ 58 struct hash<crypto::type> { \ 59 std::size_t operator()(const crypto::type &_v) const { \ 60 return reinterpret_cast<const std::size_t &>(_v); \