diff --git a/benchmark/string_view.cpp b/benchmark/string_view.cpp index 451e6916..9fc8d1fd 100644 --- a/benchmark/string_view.cpp +++ b/benchmark/string_view.cpp @@ -17,6 +17,9 @@ #ifdef HAVE_TSL_HOPSCOTCH # include "tsl/hopscotch_map.h" #endif +#ifdef HAVE_TSL_ROBIN +# include "tsl/robin_map.h" +#endif #include #include #include @@ -141,7 +144,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 { @@ -309,6 +319,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 + // fnv1a_hash template struct fnv1a_hash_impl; @@ -387,6 +407,16 @@ template using tsl_hopscotch_pg_map_fnv1a = #endif +#ifdef HAVE_TSL_ROBIN + +template using tsl_robin_map_fnv1a = + tsl::robin_map, ::allocator< std::pair >>; + +template using tsl_robin_pg_map_fnv1a = + tsl::robin_pg_map, ::allocator< std::pair >>; + +#endif + // int main() @@ -413,6 +443,13 @@ int main() #endif +#ifdef HAVE_TSL_ROBIN + + test( "tsl::robin_map" ); + test( "tsl::robin_pg_map" ); + +#endif + #endif test( "std::unordered_map, FNV-1a" ); @@ -431,6 +468,13 @@ int main() test( "tsl::hopscotch_map, FNV-1a" ); test( "tsl::hopscotch_pg_map, FNV-1a" ); +#endif + +#ifdef HAVE_TSL_ROBIN + + test( "tsl::robin_map, FNV-1a" ); + test( "tsl::robin_pg_map, FNV-1a" ); + #endif std::cout << "---\n\n"; diff --git a/benchmark/uint64.cpp b/benchmark/uint64.cpp index 4cd1b033..817689dc 100644 --- a/benchmark/uint64.cpp +++ b/benchmark/uint64.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";