
-Compiler specifics
+
-Revised November 3rd 2025
+Revised November 7th 2025
© Copyright 2003-2025 Joaquín M López Muñoz.
Distributed under the Boost Software
diff --git a/doc/release_notes.html b/doc/release_notes.html
index 989baff5..40c15dfe 100644
--- a/doc/release_notes.html
+++ b/doc/release_notes.html
@@ -99,6 +99,8 @@
instead of a boost::tuple (and similarly for the rest of affected
class templates).
+ Removed internal workarounds and fallbacks to support pre-C++11 compilers.
+
@@ -504,7 +506,7 @@
Random access indices provide shrink_to_fit().
- Refer to the compiler specifics section for limitations
+ Refer to the compiler specifics section for limitations
on pre-C++11 compilers.
The following classes are deprecated:
@@ -823,8 +825,7 @@
Boost 1.32 release. This results in much shorter and more readable error
messages and has also a beneficial impact on compilers with strict limits on
symbol name lengths. Additionally, a section on further
- reduction of symbol name
- lengths has been added.
+ reduction of symbol name lengths has been added.
Restructured some parts of the documentation, new examples.
Maintenance fixes.
@@ -845,7 +846,7 @@
-
Revised November 3rd 2025
+
Revised November 7th 2025
© Copyright 2003-2025 Joaquín M López Muñoz.
Distributed under the Boost Software
diff --git a/example/basic.cpp b/example/basic.cpp
index 9304cf9b..4445f862 100644
--- a/example/basic.cpp
+++ b/example/basic.cpp
@@ -1,6 +1,6 @@
/* Boost.MultiIndex basic example.
*
- * Copyright 2003-2022 Joaquin M Lopez Munoz.
+ * Copyright 2003-2025 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)
@@ -47,10 +47,6 @@ struct id{};
struct name{};
struct age{};
-/* see Compiler specifics: Use of member_offset for info on
- * BOOST_MULTI_INDEX_MEMBER
- */
-
/* Define a multi_index_container of employees with following indices:
* - a unique index sorted by employee::id,
* - a non-unique index sorted by employee::name,
@@ -61,11 +57,11 @@ typedef multi_index_container<
employee,
indexed_by<
ordered_unique<
- tag, BOOST_MULTI_INDEX_MEMBER(employee,int,id)>,
+ tag, member >,
ordered_non_unique<
- tag,BOOST_MULTI_INDEX_MEMBER(employee,std::string,name)>,
+ tag,member >,
ordered_non_unique<
- tag, BOOST_MULTI_INDEX_MEMBER(employee,int,age)> >
+ tag, member > >
> employee_set;
template
diff --git a/example/bimap.cpp b/example/bimap.cpp
index aac99d06..14891f30 100644
--- a/example/bimap.cpp
+++ b/example/bimap.cpp
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of a bidirectional map.
*
- * Copyright 2003-2009 Joaquin M Lopez Munoz.
+ * Copyright 2003-2025 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)
@@ -44,30 +44,6 @@ struct bidirectional_map
ToType second;
};
-#if defined(BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS) ||\
- defined(BOOST_MSVC)&&(BOOST_MSVC<1300) ||\
- defined(BOOST_INTEL_CXX_VERSION)&&defined(_MSC_VER)&&\
- (BOOST_INTEL_CXX_VERSION<=700)
-
-/* see Compiler specifics: Use of member_offset for info on member<> and
- * member_offset<>
- */
-
- BOOST_STATIC_CONSTANT(unsigned,from_offset=offsetof(value_type,first));
- BOOST_STATIC_CONSTANT(unsigned,to_offset =offsetof(value_type,second));
-
- typedef multi_index_container<
- value_type,
- indexed_by<
- ordered_unique<
- tag,member_offset >,
- ordered_unique<
- tag, member_offset >
- >
- > type;
-
-#else
-
/* A bidirectional map can be simulated as a multi_index_container
* of pairs of (FromType,ToType) with two unique indices, one
* for each member of the pair.
@@ -82,8 +58,6 @@ struct bidirectional_map
tag, member >
>
> type;
-
-#endif
};
/* a dictionary is a bidirectional map from strings to strings */
@@ -108,22 +82,6 @@ int main()
std::string word;
std::getline(std::cin,word);
-#if defined(BOOST_NO_MEMBER_TEMPLATES) /* use global get<> and family instead */
-
- dictionary::iterator it=get(d).find(word);
- if(it!=d.end()){
- std::cout<second<<" in English"<::type::iterator it2=get<1>(d).find(word);
- if(it2!=get<1>(d).end()){
- std::cout<first<<" in Spanish"<().find(word);
@@ -143,7 +101,5 @@ int main()
else std::cout<<"No such word in the dictionary"<
>
>
> car_manufacturer_table;
@@ -118,18 +114,18 @@ typedef multi_index_container<
car_model,
indexed_by<
ordered_unique<
- tag,BOOST_MULTI_INDEX_MEMBER(car_model,std::string,model)
+ tag,member
>,
ordered_non_unique<
tag,
key_from_key<
- BOOST_MULTI_INDEX_MEMBER(car_manufacturer,const std::string,name),
- BOOST_MULTI_INDEX_MEMBER(
- car_model,const car_manufacturer *,manufacturer)
+ member,
+ member<
+ car_model,const car_manufacturer *,&car_model::manufacturer>
>
>,
ordered_non_unique<
- tag,BOOST_MULTI_INDEX_MEMBER(car_model,int,price)
+ tag,member
>
>
> car_table;
@@ -138,7 +134,7 @@ typedef multi_index_container<
* actual objects. These views are used in the complex search performed
* in the program. Resorting to multi_index of pointers eliminates
* unnecessary copying of objects, and provides us with an opportunity
- * to show how BOOST_MULTI_INDEX_MEMBER can be used with pointer
+ * to show how boost::multi_index::member can be used with pointer
* type elements.
* car_table_price_view indexes (pointers to) car_models by price.
*/
@@ -146,7 +142,7 @@ typedef multi_index_container<
typedef multi_index_container<
const car_model*,
indexed_by<
- ordered_non_unique
+ ordered_non_unique >
>
> car_table_price_view;
@@ -159,9 +155,9 @@ typedef multi_index_container<
indexed_by<
ordered_non_unique<
key_from_key<
- BOOST_MULTI_INDEX_MEMBER(car_manufacturer,const std::string,name),
- BOOST_MULTI_INDEX_MEMBER(
- car_model,const car_manufacturer * const,manufacturer)
+ member,
+ member<
+ car_model,const car_manufacturer * const,&car_model::manufacturer>
>
>
>
diff --git a/example/composite_keys.cpp b/example/composite_keys.cpp
index e9da2aff..4d2693ad 100644
--- a/example/composite_keys.cpp
+++ b/example/composite_keys.cpp
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of composite keys.
*
- * Copyright 2003-2008 Joaquin M Lopez Munoz.
+ * Copyright 2003-2025 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)
@@ -57,26 +57,22 @@ struct file_entry
* file and size. These indices are firstly ordered by directory, as commands
* work on a current directory basis. Composite keys are just fine to model
* this.
- * NB: The use of derivation here instead of simple typedef is explained in
- * Compiler specifics: type hiding.
+ * NB: The use of derivation here instead of simple typedef helps produce
+ * shorter symbol names in compilation
*/
struct name_key:composite_key<
file_entry,
- BOOST_MULTI_INDEX_MEMBER(file_entry,const file_entry*,dir),
- BOOST_MULTI_INDEX_MEMBER(file_entry,std::string,name)
+ member,
+ member
>{};
struct size_key:composite_key<
file_entry,
- BOOST_MULTI_INDEX_MEMBER(file_entry,const file_entry* const,dir),
- BOOST_MULTI_INDEX_MEMBER(file_entry,unsigned,size)
+ member,
+ member
>{};
-/* see Compiler specifics: composite_key in compilers without partial
- * template specialization, for info on composite_key_result_less
- */
-
typedef multi_index_container<
file_entry,
indexed_by<
diff --git a/example/fun_key.cpp b/example/fun_key.cpp
index 769d7bf6..a66d6212 100644
--- a/example/fun_key.cpp
+++ b/example/fun_key.cpp
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of functions used as key extractors.
*
- * Copyright 2003-2008 Joaquin M Lopez Munoz.
+ * Copyright 2003-2025 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)
@@ -54,15 +54,13 @@ std::string::size_type name_record_length(const name_record& r)
/* multi_index_container with indices based on name_record::name()
* and name_record_length().
- * See Compiler specifics: Use of const_mem_fun_explicit and
- * mem_fun_explicit for info on BOOST_MULTI_INDEX_CONST_MEM_FUN.
*/
typedef multi_index_container<
name_record,
indexed_by<
ordered_unique<
- BOOST_MULTI_INDEX_CONST_MEM_FUN(name_record,std::string,name)
+ const_mem_fun
>,
ordered_non_unique<
global_fun
diff --git a/example/hashed.cpp b/example/hashed.cpp
index 98228ea2..0bfac217 100644
--- a/example/hashed.cpp
+++ b/example/hashed.cpp
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of use of hashed indices.
*
- * Copyright 2003-2008 Joaquin M Lopez Munoz.
+ * Copyright 2003-2025 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)
@@ -37,19 +37,15 @@ struct word_counter_entry
word_counter_entry(std::string word_):word(word_),occurrences(0){}
};
-/* see Compiler specifics: Use of member_offset for info on
- * BOOST_MULTI_INDEX_MEMBER
- */
-
typedef multi_index_container<
word_counter_entry,
indexed_by<
ordered_non_unique<
- BOOST_MULTI_INDEX_MEMBER(word_counter_entry,unsigned int,occurrences),
+ member,
std::greater /* sorted beginning with most frequent */
>,
hashed_unique<
- BOOST_MULTI_INDEX_MEMBER(word_counter_entry,std::string,word)
+ member
>
>
> word_counter;
diff --git a/example/ip_allocator.cpp b/example/ip_allocator.cpp
index f2c6d677..85821bce 100644
--- a/example/ip_allocator.cpp
+++ b/example/ip_allocator.cpp
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of use of Boost.Interprocess allocators.
*
- * Copyright 2003-2008 Joaquin M Lopez Munoz.
+ * Copyright 2003-2025 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)
@@ -104,22 +104,18 @@ struct partial_str_less
* * We are using a Boost.Interprocess specific allocator.
*/
-/* see Compiler specifics: Use of member_offset for info on
- * BOOST_MULTI_INDEX_MEMBER
- */
-
typedef multi_index_container<
book,
indexed_by<
ordered_non_unique<
- BOOST_MULTI_INDEX_MEMBER(book,shared_string,author)
+ member
>,
ordered_non_unique<
- BOOST_MULTI_INDEX_MEMBER(book,shared_string,name),
+ member,
partial_str_less
>,
ordered_non_unique<
- BOOST_MULTI_INDEX_MEMBER(book,unsigned,prize)
+ member
>
>,
bip::allocator
diff --git a/example/rearrange.cpp b/example/rearrange.cpp
index 97edd4ea..37a2d3dc 100644
--- a/example/rearrange.cpp
+++ b/example/rearrange.cpp
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of use of rearrange facilities.
*
- * Copyright 2003-2020 Joaquin M Lopez Munoz.
+ * Copyright 2003-2025 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)
@@ -22,11 +22,8 @@
#include
#include
#include
-#include
-
-#if !defined(BOOST_NO_CXX11_HDR_RANDOM)
#include
-#endif
+#include
using boost::multi_index_container;
using namespace boost::multi_index;
@@ -197,22 +194,12 @@ struct random_shuffler
private:
deck_view dv;
-
-#if !defined(BOOST_NO_CXX11_HDR_RANDOM)
std::mt19937 e;
void shuffle_view()
{
std::shuffle(dv.begin(),dv.end(),e);
}
-#else
- /* for pre-C++11 compilers we use std::random_shuffle */
-
- void shuffle_view()
- {
- std::random_shuffle(dv.begin(),dv.end());
- }
-#endif
};
/* Repeat a given shuffling algorithm repeats_num times
diff --git a/include/boost/multi_index/composite_key.hpp b/include/boost/multi_index/composite_key.hpp
index d0e04932..101933f5 100644
--- a/include/boost/multi_index/composite_key.hpp
+++ b/include/boost/multi_index/composite_key.hpp
@@ -17,7 +17,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/include/boost/multi_index/detail/access_specifier.hpp b/include/boost/multi_index/detail/access_specifier.hpp
deleted file mode 100644
index f3346e83..00000000
--- a/include/boost/multi_index/detail/access_specifier.hpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Copyright 2003-2013 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)
- *
- * See http://www.boost.org/libs/multi_index for library home page.
- */
-
-#ifndef BOOST_MULTI_INDEX_DETAIL_ACCESS_SPECIFIER_HPP
-#define BOOST_MULTI_INDEX_DETAIL_ACCESS_SPECIFIER_HPP
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#include
-#include
-
-/* In those compilers that do not accept the member template friend syntax,
- * some protected and private sections might need to be specified as
- * public.
- */
-
-#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
-#define BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS public
-#define BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS public
-#else
-#define BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS protected
-#define BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS private
-#endif
-
-/* GCC does not correctly support in-class using declarations for template
- * functions. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9810
- * MSVC 7.1/8.0 seem to have a similar problem, though the conditions in
- * which the error happens are not that simple. I have yet to isolate this
- * into a snippet suitable for bug reporting.
- * Sun Studio also has this problem, which might be related, from the
- * information gathered at Sun forums, with a known issue notified at the
- * internal bug report 6421933. The bug is present up to Studio Express 2,
- * the latest preview version of the future Sun Studio 12. As of this writing
- * (October 2006) it is not known whether a fix will finally make it into the
- * official Sun Studio 12.
- */
-
-#if BOOST_WORKAROUND(__GNUC__,==3)&&(__GNUC_MINOR__<4)||\
- BOOST_WORKAROUND(BOOST_MSVC,==1310)||\
- BOOST_WORKAROUND(BOOST_MSVC,==1400)||\
- BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
-#define BOOST_MULTI_INDEX_PRIVATE_IF_USING_DECL_FOR_TEMPL_FUNCTIONS public
-#else
-#define BOOST_MULTI_INDEX_PRIVATE_IF_USING_DECL_FOR_TEMPL_FUNCTIONS private
-#endif
-
-#endif
diff --git a/include/boost/multi_index/detail/adl_swap.hpp b/include/boost/multi_index/detail/adl_swap.hpp
index 02b06442..77e30c55 100644
--- a/include/boost/multi_index/detail/adl_swap.hpp
+++ b/include/boost/multi_index/detail/adl_swap.hpp
@@ -1,4 +1,4 @@
-/* Copyright 2003-2013 Joaquin M Lopez Munoz.
+/* Copyright 2003-2025 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)
@@ -25,14 +25,8 @@ namespace detail{
template
void adl_swap(T& x,T& y)
{
-
-#if !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
using std::swap;
swap(x,y);
-#else
- std::swap(x,y);
-#endif
-
}
} /* namespace multi_index::detail */
diff --git a/include/boost/multi_index/detail/allocator_traits.hpp b/include/boost/multi_index/detail/allocator_traits.hpp
deleted file mode 100644
index 45903b75..00000000
--- a/include/boost/multi_index/detail/allocator_traits.hpp
+++ /dev/null
@@ -1,173 +0,0 @@
-/* Copyright 2003-2020 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)
- *
- * See http://www.boost.org/libs/multi_index for library home page.
- */
-
-#ifndef BOOST_MULTI_INDEX_DETAIL_ALLOCATOR_TRAITS_HPP
-#define BOOST_MULTI_INDEX_DETAIL_ALLOCATOR_TRAITS_HPP
-
-#if defined(_MSC_VER)
-#pragma once
-#endif
-
-#include /* keep it first to prevent nasty warns in MSVC */
-
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
-#include
-#include
-#else
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#endif
-
-namespace boost{
-
-namespace multi_index{
-
-namespace detail{
-
-/* poor man's replacement of std::allocator_traits */
-
-#if !defined(BOOST_NO_CXX11_ALLOCATOR)
-
-template struct void_helper{typedef void type;};
-
-template
-struct allocator_is_always_equal:boost::is_empty{};
-
-template
-struct allocator_is_always_equal<
- Allocator,
- typename void_helper<
- typename std::allocator_traits::is_always_equal
- >::type
->:std::allocator_traits::is_always_equal{};
-
-template
-struct allocator_traits:std::allocator_traits
-{
- /* wrap std::allocator_traits alias templates for use in C++03 codebase */
-
- typedef std::allocator_traits super;
-
- /* pre-C++17 compatibilty */
-
- typedef allocator_is_always_equal is_always_equal;
-
- template
- struct rebind_alloc
- {
- typedef typename super::template rebind_alloc type;
- };
-
- template
- struct rebind_traits
- {
- typedef typename super::template rebind_traits type;
- };
-};
-
-#else
-
-/* not a full std::allocator_traits rewrite (not needed) */
-
-template
-struct allocator_traits
-{
- typedef Allocator allocator_type;
- typedef typename Allocator::value_type value_type;
- typedef typename Allocator::pointer pointer;
- typedef typename Allocator::const_pointer const_pointer;
-
- /* [const_]void_pointer not provided as boost::pointer_traits's
- * rebind_to has been seen to fail with things like
- * boost::interprocess::offset_ptr in relatively old environments.
- */
-
- typedef typename Allocator::difference_type difference_type;
- typedef typename Allocator::size_type size_type;
-
- typedef boost::false_type propagate_on_container_copy_assignment;
- typedef boost::false_type propagate_on_container_move_assignment;
- typedef boost::false_type propagate_on_container_swap;
- typedef boost::is_empty is_always_equal;
-
- template
- struct rebind_alloc
- {
- typedef typename Allocator::template rebind::other type;
- };
-
- template
- struct rebind_traits
- {
- typedef allocator_traits::type> type;
- };
-
- static pointer allocate(Allocator& a,size_type n){return a.allocate(n);}
- static pointer allocate(Allocator& a,size_type n,const_pointer p)
- /* should've been const_void_pointer p */
- {return a.allocate(n,p);}
- static void deallocate(Allocator& a,pointer p,size_type n)
- {a.deallocate(p,n);}
- template
- static void construct(Allocator&,T* p,const T& x)
- {::new (static_cast(p)) T(x);}
- template
- static void construct(Allocator&,T* p,BOOST_RV_REF(T) x)
- {::new (static_cast(p)) T(boost::move(x));}
-
- template
- static void construct(Allocator&,T* p,BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
- {
- vartempl_placement_new(p,BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
- }
-
-#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
-/* MSVC issues spurious warnings about unreferencend formal parameters in
- * destroy when T is a class with trivial dtor.
- */
-
-#pragma warning(push)
-#pragma warning(disable:4100)
-#endif
-
- template
- static void destroy(Allocator&,T* p){p->~T();}
-
-#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
-#pragma warning(pop)
-#endif
-
- static size_type max_size(Allocator& a)BOOST_NOEXCEPT{return a.max_size();}
-
- static Allocator select_on_container_copy_construction(const Allocator& a)
- {
- return a;
- }
-};
-
-#endif
-
-template
-struct rebind_alloc_for
-{
- typedef typename allocator_traits::
- template rebind_alloc::type type;
-};
-
-} /* namespace multi_index::detail */
-
-} /* namespace multi_index */
-
-} /* namespace boost */
-
-#endif
diff --git a/include/boost/multi_index/detail/auto_space.hpp b/include/boost/multi_index/detail/auto_space.hpp
index 44945637..4ebc2274 100644
--- a/include/boost/multi_index/detail/auto_space.hpp
+++ b/include/boost/multi_index/detail/auto_space.hpp
@@ -1,4 +1,4 @@
-/* Copyright 2003-2022 Joaquin M Lopez Munoz.
+/* Copyright 2003-2025 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)
@@ -16,8 +16,8 @@
#include /* keep it first to prevent nasty warns in MSVC */
#include
#include
+#include
#include
-#include
#include
#include
@@ -46,18 +46,15 @@ namespace detail{
template >
struct auto_space:private noncopyable
{
- typedef typename rebind_alloc_for<
- Allocator,T>
- ::type allocator;
- typedef allocator_traits alloc_traits;
- typedef typename alloc_traits::pointer pointer;
- typedef typename alloc_traits::size_type size_type;
+ typedef allocator_rebind_t allocator;
+ typedef allocator_pointer_t pointer;
+ typedef allocator_size_type_t size_type;
explicit auto_space(const Allocator& al=Allocator(),size_type n=1):
- al_(al),n_(n),data_(n_?alloc_traits::allocate(al_,n_):pointer(0))
+ al_(al),n_(n),data_(n_?allocator_allocate(al_,n_):pointer(0))
{}
- ~auto_space(){if(n_)alloc_traits::deallocate(al_,data_,n_);}
+ ~auto_space(){if(n_)allocator_deallocate(al_,data_,n_);}
Allocator get_allocator()const{return al_;}
@@ -68,7 +65,8 @@ struct auto_space:private noncopyable
swap(
x,
boost::integral_constant<
- bool,alloc_traits::propagate_on_container_swap::value>());
+ bool,
+ allocator_propagate_on_container_swap_t::value>());
}
void swap(auto_space& x,boost::true_type /* swap_allocators */)
diff --git a/include/boost/multi_index/detail/bucket_array.hpp b/include/boost/multi_index/detail/bucket_array.hpp
index ccab1970..47356bb1 100644
--- a/include/boost/multi_index/detail/bucket_array.hpp
+++ b/include/boost/multi_index/detail/bucket_array.hpp
@@ -1,4 +1,4 @@
-/* Copyright 2003-2023 Joaquin M Lopez Munoz.
+/* Copyright 2003-2025 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)
@@ -15,8 +15,8 @@
#include /* keep it first to prevent nasty warns in MSVC */
#include
+#include
#include
-#include
#include
#include
#include
@@ -129,10 +129,10 @@ class bucket_array:bucket_array_base<>
{
typedef bucket_array_base<> super;
typedef hashed_index_base_node_impl<
- typename rebind_alloc_for<
+ allocator_rebind_t<
Allocator,
char
- >::type
+ >
> base_node_impl_type;
public:
@@ -224,12 +224,8 @@ void swap(bucket_array& x,bucket_array& y)
* somehow invalid archive.
*/
-#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
-namespace serialization{
-#else
namespace multi_index{
namespace detail{
-#endif
template
inline void load_construct_data(
@@ -239,12 +235,8 @@ inline void load_construct_data(
throw_exception(boost::multi_index::detail::bad_archive_exception());
}
-#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
-} /* namespace serialization */
-#else
} /* namespace multi_index::detail */
} /* namespace multi_index */
-#endif
#endif
diff --git a/include/boost/multi_index/detail/copy_map.hpp b/include/boost/multi_index/detail/copy_map.hpp
index 4e79697a..e00607e0 100644
--- a/include/boost/multi_index/detail/copy_map.hpp
+++ b/include/boost/multi_index/detail/copy_map.hpp
@@ -1,4 +1,4 @@
-/* Copyright 2003-2022 Joaquin M Lopez Munoz.
+/* Copyright 2003-2025 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)
@@ -16,14 +16,13 @@
#include /* keep it first to prevent nasty warns in MSVC */
#include
#include
+#include
#include
#include
-#include
-#include
-#include
#include
#include
#include
+#include
namespace boost{
@@ -66,21 +65,18 @@ struct copy_map_value_copier
struct copy_map_value_mover
{
template
- BOOST_RV_REF(Value) operator()(Value& x)const{return boost::move(x);}
+ Value&& operator()(Value& x)const{return std::move(x);}
};
template
class copy_map:private noncopyable
{
- typedef typename rebind_alloc_for<
- Allocator,Node
- >::type allocator_type;
- typedef allocator_traits alloc_traits;
- typedef typename alloc_traits::pointer pointer;
+ typedef allocator_rebind_t allocator_type;
+ typedef allocator_pointer_t pointer;
public:
- typedef const copy_map_entry* const_iterator;
- typedef typename alloc_traits::size_type size_type;
+ typedef const copy_map_entry* const_iterator;
+ typedef allocator_size_type_t size_type;
copy_map(
const Allocator& al,size_type size,Node* header_org,Node* header_cpy):
@@ -92,7 +88,7 @@ class copy_map:private noncopyable
{
if(!released){
for(size_type i=0;isecond->value()));
deallocate((spc.data()+i)->second);
}
@@ -128,12 +124,12 @@ class copy_map:private noncopyable
pointer allocate()
{
- return alloc_traits::allocate(al_,1);
+ return allocator_allocate(al_,1);
}
void deallocate(Node* node)
{
- alloc_traits::deallocate(al_,static_cast(node),1);
+ allocator_deallocate(al_,static_cast(node),1);
}
template
@@ -142,7 +138,7 @@ class copy_map:private noncopyable
(spc.data()+n)->first=node;
(spc.data()+n)->second=raw_ptr(allocate());
BOOST_TRY{
- alloc_traits::construct(
+ allocator_construct(
al_,boost::addressof((spc.data()+n)->second->value()),
access(node->value()));
}
diff --git a/include/boost/multi_index/detail/hash_index_node.hpp b/include/boost/multi_index/detail/hash_index_node.hpp
index bcb4745e..17bd966d 100644
--- a/include/boost/multi_index/detail/hash_index_node.hpp
+++ b/include/boost/multi_index/detail/hash_index_node.hpp
@@ -1,4 +1,4 @@
-/* Copyright 2003-2020 Joaquin M Lopez Munoz.
+/* Copyright 2003-2025 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)
@@ -14,7 +14,7 @@
#endif
#include /* keep it first to prevent nasty warns in MSVC */
-#include
+#include
#include
#include
@@ -99,19 +99,17 @@ struct hashed_index_node_impl;
template
struct hashed_index_base_node_impl
{
- typedef typename rebind_alloc_for<
+ typedef allocator_rebind_t<
Allocator,hashed_index_base_node_impl
- >::type base_allocator;
- typedef typename rebind_alloc_for<
+ > base_allocator;
+ typedef allocator_rebind_t<
Allocator,hashed_index_node_impl
- >::type node_allocator;
- typedef allocator_traits base_alloc_traits;
- typedef allocator_traits node_alloc_traits;
- typedef typename base_alloc_traits::pointer base_pointer;
- typedef typename base_alloc_traits::const_pointer const_base_pointer;
- typedef typename node_alloc_traits::pointer pointer;
- typedef typename node_alloc_traits::const_pointer const_pointer;
- typedef typename node_alloc_traits::difference_type difference_type;
+ > node_allocator;
+ typedef allocator_pointer_t base_pointer;
+ typedef allocator_const_pointer_t const_base_pointer;
+ typedef allocator_pointer_t pointer;
+ typedef allocator_const_pointer_t const_pointer;
+ typedef allocator_difference_type_t difference_type;
pointer& prior(){return prior_;}
pointer prior()const{return prior_;}
@@ -689,14 +687,14 @@ struct hashed_index_node_alg
template
struct hashed_index_node_trampoline:
hashed_index_node_impl<
- typename rebind_alloc_for<
+ allocator_rebind_t<
typename Super::allocator_type,char
- >::type
+ >
>
{
- typedef typename rebind_alloc_for<
+ typedef allocator_rebind_t<
typename Super::allocator_type,char
- >::type impl_allocator_type;
+ > impl_allocator_type;
typedef hashed_index_node_impl impl_type;
};
diff --git a/include/boost/multi_index/detail/index_base.hpp b/include/boost/multi_index/detail/index_base.hpp
index 48e9d17b..591445d0 100644
--- a/include/boost/multi_index/detail/index_base.hpp
+++ b/include/boost/multi_index/detail/index_base.hpp
@@ -15,17 +15,14 @@
#include /* keep it first to prevent nasty warns in MSVC */
#include
+#include
#include
-#include
-#include
-#include
#include
#include
#include
#include
#include
#include
-#include
#include
#include
#include
@@ -63,9 +60,7 @@ class index_base
typedef multi_index_container<
Value,IndexSpecifierList,Allocator> final_type;
typedef tuples::null_type ctor_args_list;
- typedef typename rebind_alloc_for<
- Allocator,typename Allocator::value_type
- >::type final_allocator_type;
+ typedef Allocator final_allocator_type;
typedef node_handle<
final_node_type,final_allocator_type> final_node_handle_type;
typedef empty_type_list index_type_list;
@@ -87,8 +82,7 @@ class index_base
private:
typedef Value value_type;
- typedef allocator_traits alloc_traits;
- typedef typename alloc_traits::size_type size_type;
+ typedef allocator_size_type_t size_type;
protected:
explicit index_base(const ctor_args_list&,const Allocator&){}
@@ -120,7 +114,7 @@ class index_base
{
x=final().allocate_node();
BOOST_TRY{
- final().construct_value(x,boost::move(const_cast(v)));
+ final().construct_value(x,std::move(const_cast(v)));
}
BOOST_CATCH(...){
final().deallocate_node(x);
@@ -183,7 +177,7 @@ class index_base
bool replace_(const value_type& v,index_node_type* x,rvalue_tag)
{
- x->value()=boost::move(const_cast(v));
+ x->value()=std::move(const_cast(v));
return true;
}
@@ -241,11 +235,10 @@ class index_base
std::pair final_transfer_(Index& x,final_node_type* n)
{return final().transfer_(x,n);}
- template
- std::pair final_emplace_(
- BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
+ template
+ std::pair final_emplace_(Args&&... args)
{
- return final().emplace_(BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
+ return final().emplace_(std::forward(args)...);
}
std::pair final_insert_(
@@ -266,12 +259,11 @@ class index_base
final_node_handle_type& nh,final_node_type* position)
{return final().insert_nh_(nh,position);}
- template
+ template
std::pair final_emplace_hint_(
- final_node_type* position,BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
+ final_node_type* position,Args&&... args)
{
- return final().emplace_hint_(
- position,BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
+ return final().emplace_hint_(position,std::forward(args)...);
}
final_node_handle_type final_extract_(final_node_type* x)
@@ -294,8 +286,8 @@ class index_base
template
void final_transfer_range_(
Index& x,
- BOOST_DEDUCED_TYPENAME Index::iterator first,
- BOOST_DEDUCED_TYPENAME Index::iterator last)
+ typename Index::iterator first,
+ typename Index::iterator last)
{final().transfer_range_(x,first,last);}
void final_swap_(final_type& x){final().swap_(x);}
diff --git a/include/boost/multi_index/detail/index_node_base.hpp b/include/boost/multi_index/detail/index_node_base.hpp
index 0d37b02b..c98975ef 100644
--- a/include/boost/multi_index/detail/index_node_base.hpp
+++ b/include/boost/multi_index/detail/index_node_base.hpp
@@ -1,4 +1,4 @@
-/* Copyright 2003-2023 Joaquin M Lopez Munoz.
+/* Copyright 2003-2025 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)
@@ -105,12 +105,8 @@ Node* node_from_value(const Value* p)
* somehow invalid archive.
*/
-#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
-namespace serialization{
-#else
namespace multi_index{
namespace detail{
-#endif
template
inline void load_construct_data(
@@ -120,12 +116,8 @@ inline void load_construct_data(
throw_exception(boost::multi_index::detail::bad_archive_exception());
}
-#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
-} /* namespace serialization */
-#else
} /* namespace multi_index::detail */
} /* namespace multi_index */
-#endif
#endif
diff --git a/include/boost/multi_index/detail/is_function.hpp b/include/boost/multi_index/detail/is_function.hpp
index 765f963e..f378dd77 100644
--- a/include/boost/multi_index/detail/is_function.hpp
+++ b/include/boost/multi_index/detail/is_function.hpp
@@ -1,4 +1,4 @@
-/* Copyright 2003-2019 Joaquin M Lopez Munoz.
+/* Copyright 2003-2025 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)
@@ -16,8 +16,7 @@
#include /* keep it first to prevent nasty warns in MSVC */
#include
-#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)||\
- BOOST_WORKAROUND(_LIBCPP_VERSION,<30700)||\
+#if BOOST_WORKAROUND(_LIBCPP_VERSION,<30700)||\
BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<40802)
/* libc++: std::is_function fails,
* https://bugs.llvm.org/show_bug.cgi?id=20084
diff --git a/include/boost/multi_index/detail/is_transparent.hpp b/include/boost/multi_index/detail/is_transparent.hpp
index b3e8a0c1..45bffe12 100644
--- a/include/boost/multi_index/detail/is_transparent.hpp
+++ b/include/boost/multi_index/detail/is_transparent.hpp
@@ -37,8 +37,7 @@ struct is_transparent:std::true_type{};
} /* namespace boost */
-#if !defined(BOOST_NO_SFINAE)&&!defined(BOOST_NO_SFINAE_EXPR)&& \
- !defined(BOOST_NO_CXX11_DECLTYPE)&& \
+#if !defined(BOOST_NO_SFINAE_EXPR)&& \
(defined(BOOST_NO_CXX11_FINAL)||defined(BOOST_IS_FINAL))
#include
diff --git a/include/boost/multi_index/detail/node_handle.hpp b/include/boost/multi_index/detail/node_handle.hpp
index d25c73b2..e8ef5ff8 100644
--- a/include/boost/multi_index/detail/node_handle.hpp
+++ b/include/boost/multi_index/detail/node_handle.hpp
@@ -1,4 +1,4 @@
-/* Copyright 2003-2022 Joaquin M Lopez Munoz.
+/* Copyright 2003-2025 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)
@@ -16,20 +16,16 @@
#include /* keep it first to prevent nasty warns in MSVC */
#include
#include
+#include
+#include
#include
-#include
-#include
#include
-#include
#include
#include
-#include
-
-#if !defined(BOOST_NO_SFINAE)
-#include
#include
#include
-#endif
+#include
+#include
namespace boost{
@@ -49,16 +45,12 @@ class node_handle
typedef typename Node::value_type value_type;
typedef Allocator allocator_type;
-private:
- typedef allocator_traits alloc_traits;
-
-public:
node_handle()BOOST_NOEXCEPT:node(0){}
- node_handle(BOOST_RV_REF(node_handle) x)BOOST_NOEXCEPT:node(x.node)
+ node_handle(node_handle&& x)BOOST_NOEXCEPT:node(x.node)
{
if(!x.empty()){
- move_construct_allocator(boost::move(x));
+ move_construct_allocator(std::move(x));
x.destroy_allocator();
x.node=0;
}
@@ -72,15 +64,16 @@ class node_handle
}
}
- node_handle& operator=(BOOST_RV_REF(node_handle) x)
+ node_handle& operator=(node_handle&& x)
{
if(this!=&x){
if(!empty()){
delete_node();
if(!x.empty()){
BOOST_MULTI_INDEX_IF_CONSTEXPR(
- alloc_traits::propagate_on_container_move_assignment::value){
- move_assign_allocator(boost::move(x));
+ allocator_propagate_on_container_move_assignment_t<
+ allocator_type>::value){
+ move_assign_allocator(std::move(x));
}
x.destroy_allocator();
}
@@ -89,7 +82,7 @@ class node_handle
}
}
else if(!x.empty()){
- move_construct_allocator(boost::move(x));
+ move_construct_allocator(std::move(x));
x.destroy_allocator();
}
node=x.node;
@@ -115,24 +108,24 @@ class node_handle
void swap(node_handle& x)
BOOST_NOEXCEPT_IF(
- alloc_traits::propagate_on_container_swap::value||
- alloc_traits::is_always_equal::value)
+ allocator_propagate_on_container_swap_t::value||
+ allocator_is_always_equal_t::value)
{
if(!empty()){
if(!x.empty()){
BOOST_MULTI_INDEX_IF_CONSTEXPR(
- alloc_traits::propagate_on_container_swap::value){
+ allocator_propagate_on_container_swap_t::value){
using std::swap;
swap(*allocator_ptr(),*x.allocator_ptr());
}
}
else{
- x.move_construct_allocator(boost::move(*this));
+ x.move_construct_allocator(std::move(*this));
destroy_allocator();
}
}
else if(!x.empty()){
- move_construct_allocator(boost::move(x));
+ move_construct_allocator(std::move(x));
x.destroy_allocator();
}
std::swap(node,x.node);
@@ -145,8 +138,6 @@ class node_handle
}
private:
- BOOST_MOVABLE_BUT_NOT_COPYABLE(node_handle)
-
template
friend class boost::multi_index::multi_index_container;
@@ -177,30 +168,27 @@ class node_handle
#include
- void move_construct_allocator(BOOST_RV_REF(node_handle) x)
+ void move_construct_allocator(node_handle&& x)
{
::new (static_cast(allocator_ptr()))
- allocator_type(boost::move(*x.allocator_ptr()));
+ allocator_type(std::move(*x.allocator_ptr()));
}
- void move_assign_allocator(BOOST_RV_REF(node_handle) x)
+ void move_assign_allocator(node_handle&& x)
{
- *allocator_ptr()=boost::move(*x.allocator_ptr());
+ *allocator_ptr()=std::move(*x.allocator_ptr());
}
void destroy_allocator(){allocator_ptr()->~allocator_type();}
void delete_node()
{
- typedef typename rebind_alloc_for<
- allocator_type,Node
- >::type node_allocator;
- typedef detail::allocator_traits node_alloc_traits;
- typedef typename node_alloc_traits::pointer node_pointer;
+ typedef allocator_rebind_t node_allocator;
+ typedef allocator_pointer_t node_pointer;
- alloc_traits::destroy(*allocator_ptr(),boost::addressof(node->value()));
+ allocator_destroy(*allocator_ptr(),boost::addressof(node->value()));
node_allocator nal(*allocator_ptr());
- node_alloc_traits::deallocate(nal,static_cast(node),1);
+ allocator_deallocate(nal,static_cast(node),1);
}
Node* node;
@@ -220,31 +208,26 @@ template
struct insert_return_type
{
insert_return_type(
- Iterator position_,bool inserted_,BOOST_RV_REF(NodeHandle) node_):
- position(position_),inserted(inserted_),node(boost::move(node_)){}
- insert_return_type(BOOST_RV_REF(insert_return_type) x):
- position(x.position),inserted(x.inserted),node(boost::move(x.node)){}
+ Iterator position_,bool inserted_,NodeHandle&& node_):
+ position(position_),inserted(inserted_),node(std::move(node_)){}
+ insert_return_type(insert_return_type&& x):
+ position(x.position),inserted(x.inserted),node(std::move(x.node)){}
- insert_return_type& operator=(BOOST_RV_REF(insert_return_type) x)
+ insert_return_type& operator=(insert_return_type&& x)
{
position=x.position;
inserted=x.inserted;
- node=boost::move(x.node);
+ node=std::move(x.node);
return *this;
}
Iterator position;
bool inserted;
NodeHandle node;
-
-private:
- BOOST_MOVABLE_BUT_NOT_COPYABLE(insert_return_type)
};
/* utility for SFINAEing merge and related operations */
-#if !defined(BOOST_NO_SFINAE)
-
#define BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(Dst,Src,T) \
typename enable_if_c< \
!is_const< Dst >::value&&!is_const< Src >::value&& \
@@ -252,12 +235,6 @@ typename enable_if_c< \
T \
>::type
-#else
-
-#define BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(Dst,Src,T) T
-
-#endif
-
} /* namespace multi_index::detail */
} /* namespace multi_index */
diff --git a/include/boost/multi_index/detail/node_type.hpp b/include/boost/multi_index/detail/node_type.hpp
index 8f1e4681..3f87a12e 100644
--- a/include/boost/multi_index/detail/node_type.hpp
+++ b/include/boost/multi_index/detail/node_type.hpp
@@ -14,7 +14,6 @@
#endif
#include /* keep it first to prevent nasty warns in MSVC */
-#include