namespace folly {
+template <class KeyT, class ValueT,
+ class HashFcn, class EqualFcn, class Allocator>
+const KeyT AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::Config::
+kEmptyKey = (KeyT)-1;
+template <class KeyT, class ValueT,
+ class HashFcn, class EqualFcn, class Allocator>
+const KeyT AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::Config::
+kLockedKey = (KeyT)-2;
+template <class KeyT, class ValueT,
+ class HashFcn, class EqualFcn, class Allocator>
+const KeyT AtomicHashArray<KeyT, ValueT, HashFcn, EqualFcn, Allocator>::Config::
+kErasedKey = (KeyT)-3;
+
// AtomicHashArray private constructor --
template <class KeyT, class ValueT,
class HashFcn, class EqualFcn, class Allocator>
int entryCountThreadCacheSize;
size_t capacity; // if positive, overrides maxLoadFactor
- constexpr Config() : emptyKey((KeyT)-1),
- lockedKey((KeyT)-2),
- erasedKey((KeyT)-3),
+ private:
+ static const KeyT kEmptyKey;
+ static const KeyT kLockedKey;
+ static const KeyT kErasedKey;
+
+ public:
+ constexpr Config() : emptyKey(kEmptyKey),
+ lockedKey(kLockedKey),
+ erasedKey(kErasedKey),
maxLoadFactor(0.8),
growthFactor(-1),
entryCountThreadCacheSize(1000),
testMap<int64_t, string>();
testMap<int64_t, string, MmapAllocator<char>>();
}
+
+TEST(Aha, Create_cstr_i64) {
+ auto obj = AtomicHashArray<const char*, int64_t>::create(12);
+}