From 8d0dc6daebfa6ad8ae1c4792299be66582a5e1c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 15 Jul 2024 10:41:42 +0200 Subject: [PATCH 1/2] Fixes #285 ("devector<>::push_front asserts after clear()") --- doc/container.qbk | 1 + include/boost/container/devector.hpp | 3 - test/devector_test.cpp | 416 +++++++++++---------------- 3 files changed, 164 insertions(+), 256 deletions(-) diff --git a/doc/container.qbk b/doc/container.qbk index 4786cd2..8d3fd5c 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -1412,6 +1412,7 @@ use [*Boost.Container]? There are several reasons for that: [section:release_notes_boost_1_86_00 Boost 1.86 Release] * Fixed bugs/issues: + * [@https://github.com/boostorg/container/issues/285 GitHub #285: ['"devector<>::push_front asserts after clear()"]]. * [@https://github.com/boostorg/container/issues/280 GitHub #280: ['"Several containers don't support non-movable types when move assigning"]]. * [@https://github.com/boostorg/container/issues/279 GitHub #279: ['"small_vector cannot go back to use stack space"]]. * [@https://github.com/boostorg/container/issues/277 GitHub #277: ['"Remove dep on boost::static_assert"]]. diff --git a/include/boost/container/devector.hpp b/include/boost/container/devector.hpp index 216641c..9b1f643 100644 --- a/include/boost/container/devector.hpp +++ b/include/boost/container/devector.hpp @@ -2735,10 +2735,7 @@ class devector size_type const cap = m_.capacity; //Test if enough free memory would be left if (free_cap >= n && (free_cap - n) >= cap/devector_min_free_fraction) { - //Make sure relocation is happening because there was no enough space size_type const old_size = this->size(); - BOOST_ASSERT(should_move_back(p) ? (back_free_cap < n) : (front_free_cap < n)); - T* const raw_pos = const_cast(boost::movelib::to_raw_pointer(p)); size_type const new_size = old_size + n; size_type const new_front_idx = (cap - new_size) / 2u; diff --git a/test/devector_test.cpp b/test/devector_test.cpp index 6b7fecd..9b1ec82 100644 --- a/test/devector_test.cpp +++ b/test/devector_test.cpp @@ -229,23 +229,22 @@ template void test_constructor_input_range() } BOOST_TEST(test_elem_base::no_living_elem()); -/* //if move_if_noexcept is implemented - #ifndef BOOST_NO_EXCEPTIONS - if (! boost::move_detail::is_nothrow_copy_constructible::value) - { - devector input; get_range >(16, input); + //if move_if_noexcept is implemented + //#ifndef BOOST_NO_EXCEPTIONS + //if (! boost::move_detail::is_nothrow_copy_constructible::value) + //{ + //devector input; get_range >(16, input); - input_iterator input_begin = make_input_iterator(input, input.begin()); - input_iterator input_end = make_input_iterator(input, input.end()); + //input_iterator input_begin = make_input_iterator(input, input.begin()); + //input_iterator input_end = make_input_iterator(input, input.end()); - test_elem_throw::on_copy_after(4); + //test_elem_throw::on_copy_after(4); - BOOST_TEST_THROWS(Devector c(input_begin, input_end), test_exception); - } + //BOOST_TEST_THROWS(Devector c(input_begin, input_end), test_exception); + //} - BOOST_TEST(test_elem_base::no_living_elem()); - #endif //#ifndef BOOST_NO_EXCEPTIONS -*/ + //BOOST_TEST(test_elem_base::no_living_elem()); + //#endif //#ifndef BOOST_NO_EXCEPTIONS } @@ -479,25 +478,24 @@ template void test_assignment() BOOST_TEST(a.get_alloc_count() == alloc_count); } -/* - #ifndef BOOST_NO_EXCEPTIONS - typedef typename Devector::value_type T; - BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) - { + + //#ifndef BOOST_NO_EXCEPTIONS + //typedef typename Devector::value_type T; + //BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) + //{ // strong guarantee if reallocation is needed (no guarantee otherwise) - Devector a; get_range(6, a); - Devector c; get_range(12, c); - const Devector &b = c; + //Devector a; get_range(6, a); + //Devector c; get_range(12, c); + //const Devector &b = c; - test_elem_throw::on_copy_after(3); - BOOST_TEST_THROWS(a = b, test_exception); - test_elem_throw::do_not_throw(); + //test_elem_throw::on_copy_after(3); + //BOOST_TEST_THROWS(a = b, test_exception); + //test_elem_throw::do_not_throw(); - const int expected[] = {1, 2, 3, 4, 5, 6}; - test_equal_range(a, expected); - } - #endif //#ifndef BOOST_NO_EXCEPTIONS -*/ + //const int expected[] = {1, 2, 3, 4, 5, 6}; + //test_equal_range(a, expected); + //} + //#endif //#ifndef BOOST_NO_EXCEPTIONS } template void test_move_assignment_throwing(dtl::true_) @@ -624,28 +622,28 @@ template void test_il_assignment() test_equal_range(a, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); BOOST_TEST(a.get_alloc_count() == 0u); } -/* - #ifndef BOOST_NO_EXCEPTIONS - typedef typename Devector::value_type T; - BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) - { + + //#ifndef BOOST_NO_EXCEPTIONS + //typedef typename Devector::value_type T; + //BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) + //{ // strong guarantee if reallocation is needed (no guarantee otherwise) - Devector a; get_range(6, a); + //Devector a; get_range(6, a); - test_elem_throw::on_copy_after(3); + //test_elem_throw::on_copy_after(3); - BOOST_CONTAINER_TRY - { - a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; - BOOST_TEST(false); - } - BOOST_CONTAINER_CATCH(const test_exception&) {} - BOOST_CONTAINER_CATCH_END - test_elem_throw::do_not_throw(); + //BOOST_CONTAINER_TRY + //{ + //a = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; + //BOOST_TEST(false); + //} + //BOOST_CONTAINER_CATCH(const test_exception&) {} + //BOOST_CONTAINER_CATCH_END + //test_elem_throw::do_not_throw(); - test_equal_range(a, {1, 2, 3, 4, 5, 6}); - } - #endif //BOOST_NO_EXCEPTIONS*/ + //test_equal_range(a, {1, 2, 3, 4, 5, 6}); + //} + //#endif //BOOST_NO_EXCEPTIONS #endif //#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) } @@ -744,27 +742,26 @@ template void test_assign_input_range() test_equal_range(a, expected); } -/* - #ifndef BOOST_NO_EXCEPTIONS - BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) - { + + //#ifndef BOOST_NO_EXCEPTIONS + //BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) + //{ // strong guarantee if reallocation is needed (no guarantee otherwise) - devector input; get_range >(12, input); - input_iterator input_begin = make_input_iterator(input, input.begin()); - input_iterator input_end = make_input_iterator(input, input.end()); + //devector input; get_range >(12, input); + //input_iterator input_begin = make_input_iterator(input, input.begin()); + //input_iterator input_end = make_input_iterator(input, input.end()); - Devector a; get_range(6, a); + //Devector a; get_range(6, a); - test_elem_throw::on_copy_after(3); - BOOST_TEST_THROWS(a.assign(input_begin, input_end), test_exception); - test_elem_throw::do_not_throw(); + //test_elem_throw::on_copy_after(3); + //BOOST_TEST_THROWS(a.assign(input_begin, input_end), test_exception); + //test_elem_throw::do_not_throw(); - const int expected[] = {1, 2, 3, 4, 5, 6}; - test_equal_range(a, expected); - } - #endif //#ifndef BOOST_NO_EXCEPTIONS -*/ + //const int expected[] = {1, 2, 3, 4, 5, 6}; + //test_equal_range(a, expected); + //} + //#endif //#ifndef BOOST_NO_EXCEPTIONS } template void test_assign_forward_range_throwing(dtl::false_) @@ -859,21 +856,21 @@ template void test_assign_forward_range() test_equal_range(a, expected); BOOST_TEST(a.get_alloc_count() == 0u); } -/* - #ifndef BOOST_NO_EXCEPTIONS - BOOST_IF_CONSTEXPR(! boost::move_detail::is_nothrow_copy_constructible::value) - { + + //#ifndef BOOST_NO_EXCEPTIONS + //BOOST_IF_CONSTEXPR(! boost::move_detail::is_nothrow_copy_constructible::value) + //{ // strong guarantee if reallocation is needed (no guarantee otherwise) - Devector a; get_range(6, a); + //Devector a; get_range(6, a); - test_elem_throw::on_copy_after(3); - BOOST_TEST_THROWS(a.assign(one, twelve), test_exception); - test_elem_throw::do_not_throw(); + //test_elem_throw::on_copy_after(3); + //BOOST_TEST_THROWS(a.assign(one, twelve), test_exception); + //test_elem_throw::do_not_throw(); - const int expected [] = {1, 2, 3, 4, 5, 6}; - test_equal_range(a, expected); - } - #endif //#ifndef BOOST_NO_EXCEPTIONS*/ + //const int expected [] = {1, 2, 3, 4, 5, 6}; + //test_equal_range(a, expected); + //} + //#endif //#ifndef BOOST_NO_EXCEPTIONS } template void test_assign_pointer_range() @@ -947,21 +944,21 @@ template void test_assign_pointer_range() test_equal_range(a, expected); BOOST_TEST(a.get_alloc_count() == 0u); } -/* - #ifndef BOOST_NO_EXCEPTIONS - BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) - { + + //#ifndef BOOST_NO_EXCEPTIONS + //BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) + //{ // strong guarantee if reallocation is needed (no guarantee otherwise) - Devector a; get_range(6, a); + //Devector a; get_range(6, a); - test_elem_throw::on_copy_after(3); - BOOST_TEST_THROWS(a.assign(one, twelve), test_exception); - test_elem_throw::do_not_throw(); + //test_elem_throw::on_copy_after(3); + //BOOST_TEST_THROWS(a.assign(one, twelve), test_exception); + //test_elem_throw::do_not_throw(); - const int expected[] = {1, 2, 3, 4, 5, 6}; - test_equal_range(a, expected); - } - #endif //#ifndef BOOST_NO_EXCEPTIONS*/ + //const int expected[] = {1, 2, 3, 4, 5, 6}; + //test_equal_range(a, expected); + //} + //#endif //#ifndef BOOST_NO_EXCEPTIONS } template void test_assign_n() @@ -1030,22 +1027,22 @@ template void test_assign_n() test_equal_range(a, expected); BOOST_TEST(a.get_alloc_count() == 0u); } -/* - #ifndef BOOST_NO_EXCEPTIONS - BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) - { + + //#ifndef BOOST_NO_EXCEPTIONS + //BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) + //{ // strong guarantee if reallocation is needed (no guarantee otherwise) - Devector a; get_range(6, a); + //Devector a; get_range(6, a); - test_elem_throw::on_copy_after(3); - BOOST_TEST_THROWS(a.assign(32, T(9)), test_exception); - test_elem_throw::do_not_throw(); + //test_elem_throw::on_copy_after(3); + //BOOST_TEST_THROWS(a.assign(32, T(9)), test_exception); + //test_elem_throw::do_not_throw(); + + //const int expected[] = {1, 2, 3, 4, 5, 6}; + //test_equal_range(a, expected); + //} + //#endif //#ifndef BOOST_NO_EXCEPTIONS - const int expected[] = {1, 2, 3, 4, 5, 6}; - test_equal_range(a, expected); - } - #endif //#ifndef BOOST_NO_EXCEPTIONS -*/ } template void test_assign_il() @@ -1109,21 +1106,21 @@ template void test_assign_il() test_equal_range(a, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}); BOOST_TEST(a.get_alloc_count() == 0u); } -/* - #ifndef BOOST_NO_EXCEPTIONS - typedef typename Devector::value_type T; - BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) - { + + //#ifndef BOOST_NO_EXCEPTIONS + //typedef typename Devector::value_type T; + //BOOST_IF_CONSTEXPR (! boost::move_detail::is_nothrow_copy_constructible::value) + //{ // strong guarantee if reallocation is needed (no guarantee otherwise) - Devector a; get_range(6, a); + //Devector a; get_range(6, a); - test_elem_throw::on_copy_after(3); - BOOST_TEST_THROWS(a.assign({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}), test_exception); - test_elem_throw::do_not_throw(); + //test_elem_throw::on_copy_after(3); + //BOOST_TEST_THROWS(a.assign({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}), test_exception); + //test_elem_throw::do_not_throw(); - test_equal_range(a, {1, 2, 3, 4, 5, 6}); - } - #endif //#ifndef BOOST_NO_EXCEPTIONS*/ + //test_equal_range(a, {1, 2, 3, 4, 5, 6}); + //} + //#endif //#ifndef BOOST_NO_EXCEPTIONS #endif //#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) } @@ -1177,30 +1174,32 @@ template void test_empty() //using gp_devector = devector; void test_max_size() -{/* - gp_devector a; - BOOST_TEST(a.max_size() == (std::numeric_limits::max)()); +{ + #if 0 + gp_devector a; + BOOST_TEST(a.max_size() == (std::numeric_limits::max)()); - gp_devector b; - BOOST_TEST(b.max_size() == (std::numeric_limits::max)()); + gp_devector b; + BOOST_TEST(b.max_size() == (std::numeric_limits::max)()); - gp_devector c; - BOOST_TEST(c.max_size() >= b.max_size()); + gp_devector c; + BOOST_TEST(c.max_size() >= b.max_size()); - gp_devector d; - BOOST_TEST(d.max_size() >= c.max_size()); -*/ + gp_devector d; + BOOST_TEST(d.max_size() >= c.max_size()); + #endif } void test_exceeding_max_size() -{/* +{ + #if 0 #ifndef BOOST_NO_EXCEPTIONS using Devector = gp_devector; Devector a((std::numeric_limits::max)()); BOOST_TEST_THROWS(a.emplace_back(404), std::length_error); #endif //#ifndef BOOST_NO_EXCEPTIONS -*/ + #endif } template void test_size() @@ -1277,7 +1276,7 @@ template void test_resize_front() const int expected [] = {0, 0, 0, 1, 2, 3, 4, 5}; test_equal_range(b, expected); } - /* + #if 0 // size < required, move would throw if (! boost::is_nothrow_move_constructible::value && std::is_copy_constructible::value) { @@ -1289,7 +1288,7 @@ template void test_resize_front() test_equal_range(c, {0, 0, 0, 1, 2, 3, 4, 5}); } - */ + #endif test_resize_front_throwing (dtl::bool_::value>()); @@ -1456,7 +1455,7 @@ template void test_resize_back() const int expected [] = {1, 2, 3, 4, 5, 0, 0, 0}; test_equal_range(b, expected); } - /* + #if 0 // size < required, move would throw if (! boost::is_nothrow_move_constructible::value && std::is_copy_constructible::value) { @@ -1468,7 +1467,7 @@ template void test_resize_back() test_equal_range(c, {1, 2, 3, 4, 5, 0, 0, 0}); } - */ + #endif test_resize_back_throwing (dtl::bool_::value>()); @@ -1607,128 +1606,6 @@ template void test_resize_back_copy() } } -/* -template void test_constructor_unsafe_uninitialized() -{ - { - Devector a(8, unsafe_uninitialized_tag_t()); - BOOST_TEST(a.size() == 8u); - - for (int i = 0; i < 8; ++i) - { - new (a.data() + i) T(i+1); - } - - const int expected [] = {1, 2, 3, 4, 5, 6, 7, 8}; - test_equal_range(a, expected); - } - - { - Devector b(0, unsafe_uninitialized_tag_t()); - BOOST_TEST(b.get_alloc_count() == 0u); - } -} -*/ - -/* -template void test_unsafe_uninitialized_resize_front() -{ - typedef typename Devector::value_type T; - - { // noop - Devector a; get_range(8, a); - a.reset_alloc_stats(); - - a.unsafe_uninitialized_resize_front(a.size()); - - const int expected [] = {1, 2, 3, 4, 5, 6, 7, 8}; - test_equal_range(a, expected); - BOOST_TEST(a.get_alloc_count() == 0u); - } - - { // grow (maybe has enough capacity) - Devector b; get_range(0, 0, 5, 9, b); - - b.unsafe_uninitialized_resize_front(8); - - for (int i = 0; i < 4; ++i) - { - new (b.data() + i) T(i+1); - } - - const int expected [] = {1, 2, 3, 4, 5, 6, 7, 8}; - test_equal_range(b, expected); - } - - { // shrink uninitialized - Devector c; get_range(8, c); - - c.unsafe_uninitialized_resize_front(16); - c.unsafe_uninitialized_resize_front(8); - - const int expected [] = {1, 2, 3, 4, 5, 6, 7, 8}; - test_equal_range(c, expected ); - } - - if (std::is_trivially_destructible::value) - { - // shrink - Devector d; get_range(8, d); - - d.unsafe_uninitialized_resize_front(4); - - test_equal_range(d, {5, 6, 7, 8}); - } -} - -template void test_unsafe_uninitialized_resize_back() -{ - typedef typename Devector::value_type T; - - { // noop - Devector a; get_range(8, a); - a.reset_alloc_stats(); - - a.unsafe_uninitialized_resize_back(a.size()); - - test_equal_range(a, {1, 2, 3, 4, 5, 6, 7, 8}); - BOOST_TEST(a.get_alloc_count() == 0u); - } - - { // grow (maybe has enough capacity) - Devector b; get_range(1, 5, 0, 0, b); - - b.unsafe_uninitialized_resize_back(8); - - for (int i = 0; i < 4; ++i) - { - new (b.data() + 4 + i) T(i+5); - } - - test_equal_range(b, {1, 2, 3, 4, 5, 6, 7, 8}); - } - - { // shrink uninitialized - Devector c; get_range(8, c); - - c.unsafe_uninitialized_resize_back(16); - c.unsafe_uninitialized_resize_back(8); - - test_equal_range(c, {1, 2, 3, 4, 5, 6, 7, 8}); - } - - if (std::is_trivially_destructible::value) - { - // shrink - Devector d; get_range(8, d); - - d.unsafe_uninitialized_resize_back(4); - - test_equal_range(d, {1, 2, 3, 4}); - } -} -*/ - template void test_reserve_front() { typedef typename Devector::value_type value_type; @@ -3625,6 +3502,39 @@ template void test_clear() BOOST_TEST(a.empty()); BOOST_TEST(cp == a.capacity()); } + + { + Devector a; + a.push_front(42); + typename Devector::size_type cp = a.capacity(); + a.clear(); + BOOST_TEST(a.empty()); + BOOST_TEST(cp == a.capacity()); + a.push_front(42); + a.clear(); + BOOST_TEST(a.empty()); + BOOST_TEST(cp == a.capacity()); + a.push_back(42); + a.clear(); + BOOST_TEST(a.empty()); + BOOST_TEST(cp == a.capacity()); + } + { + Devector a; + a.push_back(42); + typename Devector::size_type cp = a.capacity(); + a.clear(); + BOOST_TEST(a.empty()); + BOOST_TEST(cp == a.capacity()); + a.push_back(42); + a.clear(); + BOOST_TEST(a.empty()); + BOOST_TEST(cp == a.capacity()); + a.push_front(42); + a.clear(); + BOOST_TEST(a.empty()); + BOOST_TEST(cp == a.capacity()); + } } template void test_op_eq() @@ -3916,10 +3826,10 @@ struct GetAllocatorCont void test_all() { - test_recursive_devector();/* + test_recursive_devector(); test_max_size(); - test_exceeding_max_size(); - shrink_to_fit();*/ + //test_exceeding_max_size(); + //shrink_to_fit(); test_data(); test_il_assignment< devector >(); test_assign_forward_range< devector >(); From 4ea9c64316766590e297960f8b26bc04ac0af4d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Mon, 15 Jul 2024 11:50:50 +0200 Subject: [PATCH 2/2] Use algo_equal to reduce test dependencies --- test/devector_test.cpp | 14 +++++++------- test/test_util.hpp | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/test/devector_test.cpp b/test/devector_test.cpp index 9b1ec82..ad2545d 100644 --- a/test/devector_test.cpp +++ b/test/devector_test.cpp @@ -25,7 +25,7 @@ #include "check_equal_containers.hpp" #include "movable_int.hpp" -#include +#include //algo_equal(), algo_lexicographical_compare #define BOOST_CONTAINER_DEVECTOR_ALLOC_STATS #include @@ -1136,17 +1136,17 @@ template void test_begin_end() { Devector actual; get_range(10, actual); - BOOST_TEST(boost::algorithm::equal(expected.begin(), expected.end(), actual.begin(), actual.end())); - BOOST_TEST(boost::algorithm::equal(expected.rbegin(), expected.rend(), actual.rbegin(), actual.rend())); - BOOST_TEST(boost::algorithm::equal(expected.cbegin(), expected.cend(), actual.cbegin(), actual.cend())); - BOOST_TEST(boost::algorithm::equal(expected.crbegin(), expected.crend(), actual.crbegin(), actual.crend())); + BOOST_TEST(::boost::container::algo_equal(expected.begin(), expected.end(), actual.begin(), actual.end())); + BOOST_TEST(::boost::container::algo_equal(expected.rbegin(), expected.rend(), actual.rbegin(), actual.rend())); + BOOST_TEST(::boost::container::algo_equal(expected.cbegin(), expected.cend(), actual.cbegin(), actual.cend())); + BOOST_TEST(::boost::container::algo_equal(expected.crbegin(), expected.crend(), actual.crbegin(), actual.crend())); } { Devector cactual; get_range(10, cactual); - BOOST_TEST(boost::algorithm::equal(expected.begin(), expected.end(), cactual.begin(), cactual.end())); - BOOST_TEST(boost::algorithm::equal(expected.rbegin(), expected.rend(), cactual.rbegin(), cactual.rend())); + BOOST_TEST(::boost::container::algo_equal(expected.begin(), expected.end(), cactual.begin(), cactual.end())); + BOOST_TEST(::boost::container::algo_equal(expected.rbegin(), expected.rend(), cactual.rbegin(), cactual.rend())); } } diff --git a/test/test_util.hpp b/test/test_util.hpp index bf129a1..9161011 100644 --- a/test/test_util.hpp +++ b/test/test_util.hpp @@ -13,6 +13,7 @@ #define BOOST_CONTAINER_TEST_TEST_UTIL_HPP #include "test_elem.hpp" +#include //algo_equal(), algo_lexicographical_compare // get_range @@ -86,8 +87,7 @@ void print_range(std::ostream& out, Array (&range)[N]) template void test_equal_range(const C1& a, const C2 (&b)[N]) { - bool equals = boost::algorithm::equal - (a.begin(), a.end(), b, b+N); + bool equals = ::boost::container::algo_equal(a.begin(), a.end(), b, b+N); BOOST_TEST(equals); @@ -104,7 +104,7 @@ void test_equal_range(const C1& a, const C2 (&b)[N]) template void test_equal_range(const C1& a, const C2&b) { - bool equals = boost::algorithm::equal + bool equals = boost::container::algo_equal (a.begin(), a.end(), b.begin(), b.end()); BOOST_TEST(equals);