emhash
emhash copied to clipboard
Default load factor ODR issue
#include <emhash/hash_set8.hpp>
#include <emhash/hash_table8.hpp>
These headers share the same definition of emhash8::EMH_DEFAULT_LOAD_FACTOR emhash8::EMH_MIN_LOAD_FACTOR which causes a source file which includes both these headers failing to compile.
In included file: redefinition of 'EMH_DEFAULT_LOAD_FACTOR'
Perhaps it's a little more flexible solution to configure them as template parameters, like
struct DefaultPolicy {
static constexpr float load_factor = 0.80f;
static constexpr size_t cacheline_size = 64U;
};
template <typename K, typname V, typename H, typename E, typename Alloc, typename Policy = DefaultPolicy>
struct ...
u are right, maybe I need remove some marcos.
I have fix some compile issue, thanks for report