mirror of
https://github.com/boostorg/unordered.git
synced 2025-05-11 13:34:06 +00:00
Add max_size() impl
This commit is contained in:
parent
6fed6ea5ad
commit
ac5a99da31
@ -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
|
||||
{
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user