diff --git a/include/boost/unordered/concurrent_flat_map.hpp b/include/boost/unordered/concurrent_flat_map.hpp index 15f45de2..72101d7b 100644 --- a/include/boost/unordered/concurrent_flat_map.hpp +++ b/include/boost/unordered/concurrent_flat_map.hpp @@ -1,7 +1,7 @@ /* Fast open-addressing concurrent hashmap. * * Copyright 2023 Christian Mazakas. - * Copyright 2023 Joaquin M Lopez Munoz. + * Copyright 2023-2024 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -75,6 +75,10 @@ namespace boost { typename boost::allocator_const_pointer::type; static constexpr size_type bulk_visit_size = table_type::bulk_visit_size; +#if defined(BOOST_UNORDERED_ENABLE_STATS) + using stats = typename table_type::stats; +#endif + concurrent_flat_map() : concurrent_flat_map(detail::foa::default_bucket_count) { @@ -714,6 +718,15 @@ namespace boost { void rehash(size_type n) { table_.rehash(n); } void reserve(size_type n) { table_.reserve(n); } +#if defined(BOOST_UNORDERED_ENABLE_STATS) + /// Stats + /// + + stats get_stats() const { return table_.get_stats(); } + + void reset_stats() { table_.reset_stats(); } +#endif + /// Observers /// allocator_type get_allocator() const noexcept