From 4e7cfa208d814e11b51a7ab194b0981e5bc818c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20M=2E=20L=C3=B3pez=20Mu=C3=B1oz?= Date: Mon, 10 May 2004 05:53:31 +0000 Subject: [PATCH] trivial bug in index_base::final_max_size_ [SVN r22774] --- include/boost/multi_index/detail/index_base.hpp | 2 +- test/test_capacity.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/boost/multi_index/detail/index_base.hpp b/include/boost/multi_index/detail/index_base.hpp index cec41d2..4e56e21 100644 --- a/include/boost/multi_index/detail/index_base.hpp +++ b/include/boost/multi_index/detail/index_base.hpp @@ -101,7 +101,7 @@ protected: bool final_empty_()const{return final().empty_();} std::size_t final_size_()const{return final().size_();} - std::size_t final_max_size_()const{return final.max_size_();} + std::size_t final_max_size_()const{return final().max_size_();} std::pair final_insert_(value_param_type x) {return final().insert_(x);} diff --git a/test/test_capacity.cpp b/test/test_capacity.cpp index 9e0390a..7b254c3 100644 --- a/test/test_capacity.cpp +++ b/test/test_capacity.cpp @@ -29,6 +29,7 @@ void test_capacity() BOOST_CHECK(!es.empty()); BOOST_CHECK(es.size()==5); + BOOST_CHECK(es.size()<=es.max_size()); es.erase(es.begin()); BOOST_CHECK(get(es).size()==4); @@ -36,11 +37,13 @@ void test_capacity() es.erase(es.begin()); BOOST_CHECK(!get(es).empty()); BOOST_CHECK(get(es).size()==3); + BOOST_CHECK(get(es).size()<=get(es).max_size()); multi_index_container > > ss; ss.resize(10); BOOST_CHECK(ss.size()==10); + BOOST_CHECK(ss.size()<=ss.max_size()); ss.resize(20); BOOST_CHECK(ss.size()==20);