From 0ca8c5f56f720d4322ee1635bf25fb4407acb0ad Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 22 Jul 2022 18:36:50 +0300 Subject: [PATCH] Add tsl::robin_map to uint32.cpp --- benchmark/uint32.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/benchmark/uint32.cpp b/benchmark/uint32.cpp index b7acf05a..f1d9f7ea 100644 --- a/benchmark/uint32.cpp +++ b/benchmark/uint32.cpp @@ -18,6 +18,9 @@ #ifdef HAVE_TSL_HOPSCOTCH # include "tsl/hopscotch_map.h" #endif +#ifdef HAVE_TSL_ROBIN +# include "tsl/robin_map.h" +#endif #include #include #include @@ -150,7 +153,14 @@ template BOOST_NOINLINE void test_iteration( Map& map, std::chrono::s { if( it->second & 1 ) { - map.erase( it++ ); + if constexpr( std::is_void_v< decltype( map.erase( it ) ) > ) + { + map.erase( it++ ); + } + else + { + it = map.erase( it ); + } } else { @@ -325,6 +335,16 @@ template using tsl_hopscotch_pg_map = #endif +#ifdef HAVE_TSL_ROBIN + +template using tsl_robin_map = + tsl::robin_map, std::equal_to, ::allocator< std::pair >>; + +template using tsl_robin_pg_map = + tsl::robin_pg_map, std::equal_to, ::allocator< std::pair >>; + +#endif + int main() { init_indices(); @@ -345,6 +365,13 @@ int main() test( "tsl::hopscotch_map" ); test( "tsl::hopscotch_pg_map" ); +#endif + +#ifdef HAVE_TSL_ROBIN + + test( "tsl::robin_map" ); + test( "tsl::robin_pg_map" ); + #endif std::cout << "---\n\n";