Add max_size() impl

This commit is contained in:
Christian Mazakas 2023-06-15 09:17:25 -07:00
parent 6fed6ea5ad
commit ac5a99da31
2 changed files with 10 additions and 0 deletions

View File

@ -246,6 +246,7 @@ namespace boost {
///
size_type size() const noexcept { return table_.size(); }
size_type max_size() const noexcept { return table_.max_size(); }
BOOST_ATTRIBUTE_NODISCARD bool empty() const noexcept
{

View File

@ -5,6 +5,7 @@
#include "helpers.hpp"
#include <boost/config/workaround.hpp>
#include <boost/unordered/concurrent_flat_map_fwd.hpp>
#include <limits>
test::seed_t initialize_seed{32304628};
@ -58,4 +59,12 @@ UNORDERED_AUTO_TEST (fwd_unequal_call) {
BOOST_TEST_NOT(unequal_call(x1, x2));
}
// this isn't the best place for this test but it's better than introducing a
// new file
UNORDERED_AUTO_TEST (max_size) {
map_type x1;
BOOST_TEST_EQ(
x1.max_size(), std::numeric_limits<typename map_type::size_type>::max());
}
RUN_TESTS()