added stats to the rest of open-addressing containers

This commit is contained in:
joaquintides
2024-04-29 11:23:15 +02:00
parent 05b66e1034
commit b07cee08c4
3 changed files with 39 additions and 0 deletions

View File

@ -72,6 +72,10 @@ namespace boost {
using iterator = typename table_type::iterator;
using const_iterator = typename table_type::const_iterator;
#if defined(BOOST_UNORDERED_ENABLE_STATS)
using stats = typename table_type::stats;
#endif
unordered_flat_set() : unordered_flat_set(0) {}
explicit unordered_flat_set(size_type n, hasher const& h = hasher(),
@ -474,6 +478,15 @@ namespace boost {
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
///

View File

@ -115,6 +115,10 @@ namespace boost {
using insert_return_type =
detail::foa::insert_return_type<iterator, node_type>;
#if defined(BOOST_UNORDERED_ENABLE_STATS)
using stats = typename table_type::stats;
#endif
unordered_node_map() : unordered_node_map(0) {}
explicit unordered_node_map(size_type n, hasher const& h = hasher(),
@ -749,6 +753,15 @@ namespace boost {
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
///

View File

@ -105,6 +105,10 @@ namespace boost {
using insert_return_type =
detail::foa::insert_return_type<iterator, node_type>;
#if defined(BOOST_UNORDERED_ENABLE_STATS)
using stats = typename table_type::stats;
#endif
unordered_node_set() : unordered_node_set(0) {}
explicit unordered_node_set(size_type n, hasher const& h = hasher(),
@ -563,6 +567,15 @@ namespace boost {
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
///