Electroneum
Macros
generic-ops.h File Reference
#include <cstddef>
#include <cstring>
#include <functional>
Include dependency graph for generic-ops.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CRYPTO_MAKE_COMPARABLE(type)
 
#define CRYPTO_MAKE_HASHABLE(type)
 

Macro Definition Documentation

◆ CRYPTO_MAKE_COMPARABLE

#define CRYPTO_MAKE_COMPARABLE (   type)
Value:
namespace crypto { \
inline bool operator==(const type &_v1, const type &_v2) { \
return std::memcmp(&_v1, &_v2, sizeof(type)) == 0; \
} \
inline bool operator!=(const type &_v1, const type &_v2) { \
return std::memcmp(&_v1, &_v2, sizeof(type)) != 0; \
} \
}
static bool operator!=(const rct::key &k0, const crypto::public_key &k1)
Definition: rctTypes.h:437
crypto namespace.
Definition: crypto.cpp:47
type
Definition: json.h:74
bool operator==(const cryptonote::transaction &a, const cryptonote::transaction &b)
Definition: cryptonote_basic_impl.cpp:351

◆ CRYPTO_MAKE_HASHABLE

#define CRYPTO_MAKE_HASHABLE (   type)
Value:
namespace crypto { \
static_assert(sizeof(std::size_t) <= sizeof(type), "Size of " #type " must be at least that of size_t"); \
inline std::size_t hash_value(const type &_v) { \
return reinterpret_cast<const std::size_t &>(_v); \
} \
} \
namespace std { \
template<> \
struct hash<crypto::type> { \
std::size_t operator()(const crypto::type &_v) const { \
return reinterpret_cast<const std::size_t &>(_v); \
} \
}; \
}
#define CRYPTO_MAKE_COMPARABLE(type)
Definition: generic-ops.h:38
crypto namespace.
Definition: crypto.cpp:47
Definition: block_queue.cpp:41
type
Definition: json.h:74