flat_hash_map test passes

This commit is contained in:
greg
2019-03-24 18:10:20 -04:00
parent 31f86eb669
commit ddebdfbcdc
2 changed files with 19 additions and 3 deletions
+17
View File
@@ -48,9 +48,26 @@ if (PHMAP_BUILD_TESTS)
check_target(gtest_main)
check_target(gmock)
# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/parallel_hashmap)
phmap_cc_test(NAME flat_hash_set SRCS "tests/flat_hash_set_test.cc"
COPTS "-DUNORDERED_SET_CXX17" DEPS gmock_main)
phmap_cc_test(NAME flat_hash_map SRCS "tests/flat_hash_map_test.cc"
DEPS gmock_main)
phmap_cc_test(NAME parallel_flat_hash_map SRCS "tests/parallel_flat_hash_map_test.cc"
COPTS "-DUNORDERED_MAP_CXX17" DEPS gmock_main)
phmap_cc_test(NAME parallel_flat_hash_set SRCS "tests/parallel_flat_hash_set_test.cc"
COPTS "-DUNORDERED_SET_CXX17" DEPS gmock_main)
phmap_cc_test(NAME node_hash_map SRCS "tests/node_hash_map_test.cc"
DEPS gmock_main)
phmap_cc_test(NAME node_hash_set SRCS "tests/node_hash_set_test.cc"
COPTS "-DUNORDERED_SET_CXX17" DEPS gmock_main)
endif()
if (PHMAP_BUILD_EXAMPLES)
+2 -3
View File
@@ -47,10 +47,9 @@ template <class T> T phmap_max(T a, T b) { return a >= b ? a : b; }
template <class T>
struct Hash
{
inline size_t operator()(const T &__v) const noexcept
inline size_t operator()(const T& __v) noexcept
{
PHMAP_HASH_CLASS<T> hasher;
return hasher(__v);
return PHMAP_HASH_CLASS<T>()(__v);
}
};