From b3aeed0544948faa68646ca0029cf6da4dd82cc2 Mon Sep 17 00:00:00 2001 From: Tessil Date: Sun, 20 Aug 2017 18:46:02 +0200 Subject: [PATCH] Add tsl::robin_pg_map and tsl::robin_pg_set for a shortcut to use ts::prime_growth_policy_rh. --- tests/robin_map_tests.cpp | 8 ++------ tests/robin_set_tests.cpp | 7 +------ tsl/robin_map.h | 12 ++++++++++-- tsl/robin_set.h | 8 ++++++++ 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/tests/robin_map_tests.cpp b/tests/robin_map_tests.cpp index ed8d88c..d9daa7b 100644 --- a/tests/robin_map_tests.cpp +++ b/tests/robin_map_tests.cpp @@ -60,9 +60,7 @@ using test_types = boost::mpl::list< tsl::robin_map, std::equal_to, std::allocator>, true, tsl::power_of_two_growth_policy_rh<4>>, - tsl::robin_map, std::equal_to, - std::allocator>, false, - tsl::prime_growth_policy_rh>, + tsl::robin_pg_map>, tsl::robin_map, std::equal_to, std::allocator>, false, tsl::mod_growth_policy_rh<>>, @@ -70,9 +68,7 @@ using test_types = boost::mpl::list< tsl::robin_map, std::equal_to, std::allocator>, false, tsl::power_of_two_growth_policy_rh<4>>, - tsl::robin_map, std::equal_to, - std::allocator>, true, - tsl::prime_growth_policy_rh>, + tsl::robin_pg_map>, tsl::robin_map, std::equal_to, std::allocator>, true, tsl::mod_growth_policy_rh<>> diff --git a/tests/robin_set_tests.cpp b/tests/robin_set_tests.cpp index b87576b..1c610c7 100644 --- a/tests/robin_set_tests.cpp +++ b/tests/robin_set_tests.cpp @@ -44,12 +44,7 @@ using test_types = boost::mpl::list, tsl::robin_set, tsl::robin_set, tsl::robin_set, - tsl::robin_set, - std::equal_to, - std::allocator, - false, - tsl::prime_growth_policy_rh>, + tsl::robin_pg_set, tsl::robin_set, std::equal_to, diff --git a/tsl/robin_map.h b/tsl/robin_map.h index 8f1461b..38e275f 100644 --- a/tsl/robin_map.h +++ b/tsl/robin_map.h @@ -647,11 +647,19 @@ public: lhs.swap(rhs); } - private: ht m_ht; }; -} + +template, + class KeyEqual = std::equal_to, + class Allocator = std::allocator>, + bool StoreHash = false> +using robin_pg_map = robin_map; + +} // end namespace tsl #endif diff --git a/tsl/robin_set.h b/tsl/robin_set.h index 7277251..e75e918 100644 --- a/tsl/robin_set.h +++ b/tsl/robin_set.h @@ -518,6 +518,14 @@ private: ht m_ht; }; + +template, + class KeyEqual = std::equal_to, + class Allocator = std::allocator, + bool StoreHash = false> +using robin_pg_set = robin_set; + } // end namespace tsl #endif