diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dfacdd9..5c126342 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,18 @@ jobs: os: ubuntu-24.04 install: g++-14-multilib address-model: 32,64 + - toolset: gcc-15 + cxxstd: "11,14,17,20,23,2c" + container: ubuntu:26.04 + os: ubuntu-latest + install: g++-15-multilib + address-model: 32,64 + - toolset: gcc-16 + cxxstd: "11,14,17,20,23,2c" + container: ubuntu:26.04 + os: ubuntu-latest + install: g++-16-multilib + address-model: 32,64 - toolset: clang compiler: clang++-3.9 cxxstd: "11,14" diff --git a/include/boost/multi_index/detail/index_base.hpp b/include/boost/multi_index/detail/index_base.hpp index 591445d0..9aad6de7 100644 --- a/include/boost/multi_index/detail/index_base.hpp +++ b/include/boost/multi_index/detail/index_base.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2025 Joaquin M Lopez Munoz. +/* Copyright 2003-2026 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -85,10 +85,16 @@ class index_base typedef allocator_size_type_t size_type; protected: - explicit index_base(const ctor_args_list&,const Allocator&){} + explicit index_base( + const ctor_args_list&,const Allocator&,index_node_type*){} index_base( const index_base&, + const Allocator&,index_node_type*){} + + index_base( + const index_base&, + const Allocator&,index_node_type*, do_not_copy_elements_tag) {} diff --git a/include/boost/multi_index/detail/ord_index_impl.hpp b/include/boost/multi_index/detail/ord_index_impl.hpp index 300052b8..82b460e9 100644 --- a/include/boost/multi_index/detail/ord_index_impl.hpp +++ b/include/boost/multi_index/detail/ord_index_impl.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2025 Joaquin M Lopez Munoz. +/* Copyright 2003-2026 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -707,8 +707,10 @@ class ordered_index_impl:protected SuperMeta::type } protected: - ordered_index_impl(const ctor_args_list& args_list,const allocator_type& al): - super(args_list.get_tail(),al), + ordered_index_impl( + const ctor_args_list& args_list, + const allocator_type& al,index_node_type* h): + super(args_list.get_tail(),al,h), key(tuples::get<0>(args_list.get_head())), comp_(tuples::get<1>(args_list.get_head())) @@ -722,8 +724,9 @@ class ordered_index_impl:protected SuperMeta::type ordered_index_impl( const ordered_index_impl< - KeyFromValue,Compare,SuperMeta,TagList,Category,AugmentPolicy>& x): - super(x), + KeyFromValue,Compare,SuperMeta,TagList,Category,AugmentPolicy>& x, + const allocator_type& al,index_node_type* h): + super(x,al,h), key(x.key), comp_(x.comp_) @@ -740,8 +743,9 @@ class ordered_index_impl:protected SuperMeta::type ordered_index_impl( const ordered_index_impl< KeyFromValue,Compare,SuperMeta,TagList,Category,AugmentPolicy>& x, + const allocator_type& al,index_node_type* h, do_not_copy_elements_tag): - super(x,do_not_copy_elements_tag()), + super(x,al,h,do_not_copy_elements_tag()), key(x.key), comp_(x.comp_) @@ -1512,6 +1516,10 @@ class ordered_index: SuperMeta,TagList,Category,AugmentPolicy > >::type super; + +protected: + typedef typename super::index_node_type index_node_type; + public: typedef typename super::ctor_args_list ctor_args_list; typedef typename super::allocator_type allocator_type; @@ -1537,13 +1545,18 @@ class ordered_index: protected: ordered_index( - const ctor_args_list& args_list,const allocator_type& al): - super(args_list,al){} + const ctor_args_list& args_list, + const allocator_type& al,index_node_type* h): + super(args_list,al,h){} - ordered_index(const ordered_index& x):super(x){} + ordered_index( + const ordered_index& x,const allocator_type& al,index_node_type* h): + super(x,al,h){} - ordered_index(const ordered_index& x,do_not_copy_elements_tag): - super(x,do_not_copy_elements_tag()){} + ordered_index( + const ordered_index& x,const allocator_type& al,index_node_type* h, + do_not_copy_elements_tag): + super(x,al,h,do_not_copy_elements_tag()){} }; #if defined(BOOST_MSVC) diff --git a/include/boost/multi_index/hashed_index.hpp b/include/boost/multi_index/hashed_index.hpp index b183e378..d33e23d1 100644 --- a/include/boost/multi_index/hashed_index.hpp +++ b/include/boost/multi_index/hashed_index.hpp @@ -735,12 +735,14 @@ class hashed_index:protected SuperMeta::type } protected: - hashed_index(const ctor_args_list& args_list,const allocator_type& al): - super(args_list.get_tail(),al), + hashed_index( + const ctor_args_list& args_list, + const allocator_type& al,index_node_type* h): + super(args_list.get_tail(),al,h), key(tuples::get<1>(args_list.get_head())), hash_(tuples::get<2>(args_list.get_head())), eq_(tuples::get<3>(args_list.get_head())), - buckets(al,header()->impl(),tuples::get<0>(args_list.get_head())), + buckets(al,h->impl(),tuples::get<0>(args_list.get_head())), mlf(1.0f) #if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE) @@ -752,12 +754,13 @@ class hashed_index:protected SuperMeta::type } hashed_index( - const hashed_index& x): - super(x), + const hashed_index& x, + const allocator_type& al,index_node_type* h): + super(x,al,h), key(x.key), hash_(x.hash_), eq_(x.eq_), - buckets(x.get_allocator(),header()->impl(),x.buckets.size()), + buckets(al,h->impl(),x.buckets.size()), mlf(x.mlf), max_load(x.max_load) @@ -773,12 +776,13 @@ class hashed_index:protected SuperMeta::type hashed_index( const hashed_index& x, + const allocator_type& al,index_node_type* h, do_not_copy_elements_tag): - super(x,do_not_copy_elements_tag()), + super(x,al,h,do_not_copy_elements_tag()), key(x.key), hash_(x.hash_), eq_(x.eq_), - buckets(x.get_allocator(),header()->impl(),0), + buckets(al,h->impl(),0), mlf(1.0f) #if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE) diff --git a/include/boost/multi_index/random_access_index.hpp b/include/boost/multi_index/random_access_index.hpp index 965f507f..9228c1df 100644 --- a/include/boost/multi_index/random_access_index.hpp +++ b/include/boost/multi_index/random_access_index.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2025 Joaquin M Lopez Munoz. +/* Copyright 2003-2026 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -741,9 +741,10 @@ class random_access_index:protected SuperMeta::type protected: random_access_index( - const ctor_args_list& args_list,const allocator_type& al): - super(args_list.get_tail(),al), - ptrs(al,header()->impl(),0) + const ctor_args_list& args_list, + const allocator_type& al,index_node_type* h): + super(args_list.get_tail(),al,h), + ptrs(al,h->impl(),0) #if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE) ,safe(*this) @@ -752,9 +753,11 @@ class random_access_index:protected SuperMeta::type { } - random_access_index(const random_access_index& x): - super(x), - ptrs(x.get_allocator(),header()->impl(),x.size()) + random_access_index( + const random_access_index& x, + const allocator_type& al,index_node_type* h): + super(x,al,h), + ptrs(al,h->impl(),x.size()) #if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE) ,safe(*this) @@ -766,9 +769,11 @@ class random_access_index:protected SuperMeta::type } random_access_index( - const random_access_index& x,do_not_copy_elements_tag): - super(x,do_not_copy_elements_tag()), - ptrs(x.get_allocator(),header()->impl(),0) + const random_access_index& x, + const allocator_type& al,index_node_type* h, + do_not_copy_elements_tag): + super(x,al,h,do_not_copy_elements_tag()), + ptrs(al,h->impl(),0) #if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE) ,safe(*this) diff --git a/include/boost/multi_index/ranked_index.hpp b/include/boost/multi_index/ranked_index.hpp index e0eaf831..f5ee38de 100644 --- a/include/boost/multi_index/ranked_index.hpp +++ b/include/boost/multi_index/ranked_index.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2025 Joaquin M Lopez Munoz. +/* Copyright 2003-2026 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -165,14 +165,19 @@ class ranked_index:public OrderedIndexImpl } protected: - ranked_index(const ranked_index& x):super(x){}; + ranked_index( + const ranked_index& x,const allocator_type& al,index_node_type* h): + super(x,al,h){}; - ranked_index(const ranked_index& x,do_not_copy_elements_tag): - super(x,do_not_copy_elements_tag()){}; + ranked_index( + const ranked_index& x,const allocator_type& al,index_node_type* h, + do_not_copy_elements_tag): + super(x,al,h,do_not_copy_elements_tag()){}; ranked_index( - const ctor_args_list& args_list,const allocator_type& al): - super(args_list,al){} + const ctor_args_list& args_list, + const allocator_type& al,index_node_type* h): + super(args_list,al,h){} private: template diff --git a/include/boost/multi_index/sequenced_index.hpp b/include/boost/multi_index/sequenced_index.hpp index 3d0f5a13..4de4fbc3 100644 --- a/include/boost/multi_index/sequenced_index.hpp +++ b/include/boost/multi_index/sequenced_index.hpp @@ -1,4 +1,4 @@ -/* Copyright 2003-2025 Joaquin M Lopez Munoz. +/* Copyright 2003-2026 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -655,8 +655,10 @@ class sequenced_index:protected SuperMeta::type } protected: - sequenced_index(const ctor_args_list& args_list,const allocator_type& al): - super(args_list.get_tail(),al) + sequenced_index( + const ctor_args_list& args_list, + const allocator_type& al,index_node_type* h): + super(args_list.get_tail(),al,h) #if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE) ,safe(*this) @@ -666,8 +668,10 @@ class sequenced_index:protected SuperMeta::type empty_initialize(); } - sequenced_index(const sequenced_index& x): - super(x) + sequenced_index( + const sequenced_index& x, + const allocator_type& al,index_node_type* h): + super(x,al,h) #if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE) ,safe(*this) @@ -678,8 +682,10 @@ class sequenced_index:protected SuperMeta::type } sequenced_index( - const sequenced_index& x,do_not_copy_elements_tag): - super(x,do_not_copy_elements_tag()) + const sequenced_index& x, + const allocator_type& al,index_node_type* h, + do_not_copy_elements_tag): + super(x,al,h,do_not_copy_elements_tag()) #if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE) ,safe(*this) diff --git a/include/boost/multi_index_container.hpp b/include/boost/multi_index_container.hpp index 5b5de389..98c4012f 100644 --- a/include/boost/multi_index_container.hpp +++ b/include/boost/multi_index_container.hpp @@ -1,6 +1,6 @@ /* Multiply indexed container. * - * Copyright 2003-2025 Joaquin M Lopez Munoz. + * Copyright 2003-2026 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -156,7 +156,7 @@ class multi_index_container: multi_index_container(): bfm_allocator(allocator_type()), - super(ctor_args_list(),bfm_allocator::member), + super(ctor_args_list(),bfm_allocator::member,&*bfm_header::member), node_count(0) { BOOST_MULTI_INDEX_CHECK_INVARIANT; @@ -166,7 +166,7 @@ class multi_index_container: const ctor_args_list& args_list, const allocator_type& al=allocator_type()): bfm_allocator(al), - super(args_list,bfm_allocator::member), + super(args_list,bfm_allocator::member,&*bfm_header::member), node_count(0) { BOOST_MULTI_INDEX_CHECK_INVARIANT; @@ -174,7 +174,7 @@ class multi_index_container: explicit multi_index_container(const allocator_type& al): bfm_allocator(al), - super(ctor_args_list(),bfm_allocator::member), + super(ctor_args_list(),bfm_allocator::member,&*bfm_header::member), node_count(0) { BOOST_MULTI_INDEX_CHECK_INVARIANT; @@ -186,7 +186,7 @@ class multi_index_container: const ctor_args_list& args_list=ctor_args_list(), const allocator_type& al=allocator_type()): bfm_allocator(al), - super(args_list,bfm_allocator::member), + super(args_list,bfm_allocator::member,&*bfm_header::member), node_count(0) { BOOST_MULTI_INDEX_CHECK_INVARIANT; @@ -210,7 +210,7 @@ class multi_index_container: const ctor_args_list& args_list=ctor_args_list(), const allocator_type& al=allocator_type()): bfm_allocator(al), - super(args_list,bfm_allocator::member), + super(args_list,bfm_allocator::member,&*bfm_header::member), node_count(0) { BOOST_MULTI_INDEX_CHECK_INVARIANT; @@ -236,8 +236,7 @@ class multi_index_container: bfm_allocator( allocator_select_on_container_copy_construction( x.bfm_allocator::member)), - bfm_header(), - super(x), + super(x,bfm_allocator::member,&*bfm_header::member), node_count(0) { copy_construct_from(x); @@ -245,8 +244,9 @@ class multi_index_container: multi_index_container(multi_index_container&& x): bfm_allocator(std::move(x.bfm_allocator::member)), - bfm_header(), - super(x,detail::do_not_copy_elements_tag()), + super( + x,bfm_allocator::member,&*bfm_header::member, + detail::do_not_copy_elements_tag()), node_count(0) { BOOST_MULTI_INDEX_CHECK_INVARIANT; @@ -258,8 +258,7 @@ class multi_index_container: const multi_index_container& x, const allocator_type& al): bfm_allocator(al), - bfm_header(), - super(x), + super(x,bfm_allocator::member,&*bfm_header::member), node_count(0) { copy_construct_from(x); @@ -268,8 +267,9 @@ class multi_index_container: multi_index_container( multi_index_container&& x,const allocator_type& al): bfm_allocator(al), - bfm_header(), - super(x,detail::do_not_copy_elements_tag()), + super( + x,bfm_allocator::member,&*bfm_header::member, + detail::do_not_copy_elements_tag()), node_count(0) { BOOST_MULTI_INDEX_CHECK_INVARIANT; @@ -492,8 +492,7 @@ class multi_index_container: const allocator_type& al, detail::unequal_alloc_move_ctor_tag): bfm_allocator(al), - bfm_header(), - super(x), + super(x,bfm_allocator::member,&*bfm_header::member), node_count(0) { BOOST_MULTI_INDEX_CHECK_INVARIANT_OF(x); @@ -524,8 +523,9 @@ class multi_index_container: const multi_index_container& x, detail::do_not_copy_elements_tag): bfm_allocator(x.bfm_allocator::member), - bfm_header(), - super(x,detail::do_not_copy_elements_tag()), + super( + x,bfm_allocator::member,&*bfm_header::member, + detail::do_not_copy_elements_tag()), node_count(0) { BOOST_MULTI_INDEX_CHECK_INVARIANT; diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index fd9cfe21..d639fda5 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1,6 +1,6 @@ # Boost.MultiIndex tests Jamfile # -# Copyright 2003-2025 Joaquín M López Muñoz. +# Copyright 2003-2026 Joaquín M López Muñoz. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) @@ -37,6 +37,7 @@ project msvc:_CRT_SECURE_NO_WARNINGS msvc:_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS msvc:/wd4494 + gcc-16:-fno-thread-jumps # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119321 ; obj boost_multi_index_key_supported : check_bmi_key_supported.cpp ; diff --git a/test/test_alloc_awareness.cpp b/test/test_alloc_awareness.cpp index b982cfd0..be1b4e1d 100644 --- a/test/test_alloc_awareness.cpp +++ b/test/test_alloc_awareness.cpp @@ -1,6 +1,6 @@ /* Boost.MultiIndex test for allocator awareness. * - * Copyright 2003-2025 Joaquin M Lopez Munoz. + * Copyright 2003-2026 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -115,7 +115,7 @@ void test_allocator_awareness_for() BOOST_TEST(element_transfer==(&*c3.begin()==pfirst)); BOOST_TEST(!element_transfer==(c3.begin()->move_cted)); } - if(Propagate||AlwaysEqual){ + BOOST_IF_CONSTEXPR(Propagate||AlwaysEqual){ container c2(c); const move_tracker* pfirst=&*c2.begin(); container c3(root2);