Compare commits

..

84 Commits

Author SHA1 Message Date
joaquintides 7c69f1af94 Merge branch 'develop' 2026-01-24 09:44:12 +01:00
joaquintides 90697ee83e Merge branch 'develop' 2025-09-20 17:53:52 +02:00
joaquintides 505284d06b Merge branch 'develop' 2025-09-11 12:41:22 +02:00
joaquintides 3a4ddd9c7a Merge branch 'develop' 2025-06-22 16:58:48 +02:00
joaquintides 1e952cd5a7 Merge branch 'develop' 2024-12-28 18:19:36 +01:00
joaquintides 216219998e Merge branch 'develop' 2024-10-12 18:07:24 +02:00
joaquintides 98a23c6fee Merge branch 'develop' 2024-10-10 12:49:27 +02:00
joaquintides d702a48363 Merge branch 'develop' 2024-03-15 09:50:21 +01:00
joaquintides fab1601a42 Merge branch 'develop' 2023-09-09 20:33:26 +02:00
joaquintides 349eef1d87 Merge branch 'develop' 2023-05-23 09:50:41 +02:00
joaquintides f4855c210f Merge branch 'develop' 2023-05-21 19:29:37 +02:00
joaquintides a5c3213de4 Merge branch 'develop' 2023-03-28 17:20:43 +02:00
joaquintides 1b61b05467 Merge branch 'develop' 2023-03-01 11:04:04 +01:00
joaquintides 261d31fb0f Merge branch 'develop' 2023-02-27 10:22:32 +01:00
joaquintides 8f221657e0 Merge branch 'develop' 2022-12-28 12:44:46 +01:00
joaquintides 288216448c Merge branch 'develop' 2022-08-28 11:18:13 +02:00
joaquintides e7c489b323 Merge branch 'develop' 2022-08-15 16:32:24 +02:00
joaquintides 90ad6104fe Merge branch 'develop' 2022-06-29 09:42:40 +02:00
joaquintides 9699a7fc87 Merge branch 'develop' 2022-04-17 18:08:44 +02:00
joaquintides 9c40dfee82 Merge branch 'develop' 2022-04-03 16:58:37 +02:00
joaquintides 65f42a1473 Merge branch 'develop' 2022-02-12 10:22:56 +01:00
joaquintides 6eb3ece5d0 Merge branch 'develop' 2021-08-30 21:03:04 +02:00
joaquintides e6f03a46eb Merge branch 'develop' 2021-08-16 12:17:20 +02:00
joaquintides 2bbf21cfc9 Merge branch 'develop' 2021-07-17 08:40:47 +02:00
joaquintides f882a54c99 Merge branch 'develop' 2021-04-19 12:02:50 +02:00
joaquintides bdd73b1956 Merge branch 'develop' 2021-04-19 11:59:43 +02:00
joaquintides a55f502312 Merge branch 'develop' 2021-01-21 09:13:58 +01:00
joaquintides b68cc2e9ef Merge branch 'develop' 2021-01-08 10:18:21 +01:00
joaquintides 512456a1ce Merge branch 'develop' 2021-01-05 17:14:12 +01:00
joaquintides 1dcb5fe137 Merge branch 'develop' 2020-06-30 16:51:44 +02:00
joaquintides b05c154f16 Merge branch 'develop' 2020-06-06 10:32:50 +02:00
joaquintides 6294e5ed9a Merge branch 'develop' 2020-06-06 10:23:03 +02:00
joaquintides 02ad3c53ba Merge branch 'develop' 2020-04-28 09:20:17 +02:00
joaquintides 7b4467f60a Merge branch 'develop' 2020-02-17 11:33:09 +01:00
joaquintides d186fc22cf Merge branch 'develop' 2020-02-10 11:35:52 +01:00
joaquintides 9d643bb542 Merge branch 'develop' 2020-01-09 15:00:34 +01:00
joaquintides 864332f16a Merge branch 'develop' 2019-12-12 12:10:38 +01:00
joaquintides 27dd132780 Merge branch 'develop' 2019-06-13 14:54:30 +02:00
joaquintides f3ed1db062 Merge branch 'develop' 2019-03-03 13:31:46 +01:00
joaquintides 6ee20e771a Merge branch 'develop' 2019-02-25 17:21:12 +01:00
joaquintides b97bf1b88c Merge branch 'develop' 2019-02-20 11:22:29 +01:00
joaquintides ff04062460 Merge branch 'develop' 2019-01-08 09:20:47 +01:00
joaquintides 3352524030 Merge branch 'develop' 2018-09-05 10:09:03 +02:00
joaquintides 06d92b4c12 Merge branch 'develop' 2018-08-16 09:32:34 +02:00
joaquintides d95a94942b Merge branch 'develop' 2018-04-23 11:12:24 +02:00
joaquintides 46e8b85d9f Merge branch 'develop' 2018-04-16 09:58:10 +02:00
joaquintides 4018129915 Merge branch 'develop' 2018-01-09 08:28:37 +01:00
joaquintides bb8603a8e8 Merge branch 'develop' 2017-12-19 14:26:37 +01:00
joaquintides ef4399e4bc Merge branch 'develop' 2017-09-25 09:41:54 +02:00
joaquintides 262f2e14d2 Merge branch 'develop' 2017-09-08 18:09:41 +02:00
joaquintides 20cef54465 Merge branch 'develop' 2017-07-13 19:33:56 +02:00
joaquintides 0b463d29f2 Merge branch 'develop' 2017-04-11 14:22:40 +02:00
joaquintides e1299f8343 Merge remote-tracking branch 'remotes/origin/develop' 2017-01-24 09:09:30 +01:00
joaquintides 0a0e7284c7 Merge branch 'develop' 2016-01-19 08:27:25 +01:00
joaquintides 5bbb047a30 Merge branch 'develop' 2015-12-08 19:44:33 +01:00
joaquintides fef3e3e457 Merge branch 'develop' 2015-10-20 07:55:50 +02:00
joaquintides 9ad2576e00 Merge branch 'develop' 2015-08-19 10:30:43 +02:00
joaquintides da77e719f3 Merge branch 'develop' 2015-08-14 19:14:59 +02:00
joaquintides c57cfda1c3 Merge branch 'develop' 2015-06-15 07:54:14 +02:00
joaquintides d6d074a1e9 Merge branch 'develop' 2015-06-14 13:10:38 +02:00
joaquintides 265bac6938 Merge branch 'develop' 2015-06-09 08:10:25 +02:00
joaquintides 0a8bc28be8 Merge branch 'develop' 2015-06-08 12:53:29 +02:00
joaquintides e0594b8ed7 Merge branch 'develop' 2015-05-04 08:19:46 +02:00
joaquintides ef2767d7d1 Merge branch 'develop' 2015-05-03 14:04:19 +02:00
joaquintides 82d74dabdc Merge branch 'develop' 2015-02-23 16:08:43 +01:00
joaquintides a07500133d Merge branch 'develop' 2015-01-16 11:17:43 +01:00
joaquintides fa7bb68b03 Merge branch 'develop' 2015-01-08 19:44:18 +01:00
joaquintides 58342f7a79 Merge branch 'develop' 2014-11-24 08:16:54 +01:00
joaquintides ae77699e7e Merge branch 'develop' 2014-11-12 13:20:34 +01:00
joaquintides 26d5ffc7fb Merge branch 'develop' 2014-11-11 23:04:40 +01:00
joaquintides e6e2d52fe3 Merge branch 'develop' 2014-11-11 21:25:33 +01:00
joaquintides 2cf8cbe771 Merge branch 'develop' 2014-11-11 10:44:56 +01:00
joaquintides 5bc2cb1905 Merge branch 'master' of https://github.com/boostorg/multi_index 2014-11-06 08:18:25 +01:00
joaquintides 4d858c2e41 Merge branch 'develop' 2014-11-06 08:17:09 +01:00
joaquintides e939bfcf63 Merge branch 'develop' 2014-10-09 08:57:06 +02:00
joaquintides f0f5c5bfaf Merge pull request #3 from boostorg/develop
Merge branch 'develop'
2014-08-21 16:26:42 +02:00
joaquintides e27ca50b51 Merge branch 'develop' 2014-07-22 15:16:05 +02:00
joaquintides e144a99544 Merge branch 'develop' 2014-07-19 20:10:14 +02:00
joaquintides f45dd2a84b Merge branch 'develop' 2014-03-26 07:43:10 +01:00
joaquintides 0be9e26b24 Merge branch 'develop' 2014-03-20 08:56:49 +01:00
joaquintides 1ff9721761 Merge branch 'develop' 2014-02-15 00:34:58 +01:00
joaquintides 7d25746bd1 Merge branch 'develop' 2014-02-12 21:51:05 +01:00
joaquintides eebd34cb95 Merge branch 'develop' 2014-01-16 08:50:08 +01:00
joaquintides d127461abe Merge branch 'develop' 2014-01-16 08:36:00 +01:00
27 changed files with 140 additions and 408 deletions
-13
View File
@@ -11,7 +11,6 @@ on:
env:
UBSAN_OPTIONS: print_stacktrace=1
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
jobs:
posix:
@@ -80,18 +79,6 @@ 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"
+2 -5
View File
@@ -552,11 +552,8 @@ scheme outlined in the
<code>p</code> shall dereference to <code>*p</code>.
</li>
</ul>
<code>multi_index_container</code>s and all their iterators do not store references
to allocated elements other than through the allocator's pointer type.
</li>
</ol>
Indices of a given <code>multi_index_container</code> instantiation cannot have
duplicate <a href="indices.html#tags">tags</a>, either within a single
index or in two different indices.
@@ -1072,9 +1069,9 @@ Index reference
<br>
<p>Revised June 27th 2026</p>
<p>Revised October 25th 2025</p>
<p>&copy; Copyright 2003-2026 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
<p>&copy; Copyright 2003-2025 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
Distributed under the Boost Software
License, Version 1.0. (See accompanying file <a href="../../../../LICENSE_1_0.txt">
LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
+2 -19
View File
@@ -30,7 +30,6 @@ Acknowledgements
<h2>Contents</h2>
<ul>
<li><a href="#boost_1_92">Boost 1.92 release</a></li>
<li><a href="#boost_1_91">Boost 1.91 release</a></li>
<li><a href="#boost_1_85">Boost 1.85 release</a></li>
<li><a href="#boost_1_84">Boost 1.84 release</a></li>
@@ -74,22 +73,6 @@ Acknowledgements
<li><a href="#boost_1_33">Boost 1.33 release</a></li>
</ul>
<h2><a name="boost_1_92">Boost 1.92 release</a></h2>
<p>
<ul>
<li>Fancy pointer support has been extended so that <code>multi_index_container</code>
iterators now store references to the elements through the allocator's pointer type.
In particular, this means that iterators can now be placed in shared memory using
<a href="../../interprocess/index.html">Boost.Interprocess</a> allocators.
</li>
<li>Fixed a performance issue with hashed indices when rehashing at very large
container sizes (<a href="https://github.com/boostorg/multi_index/pull/94">PR#94</a>).
Contributed by Daniel Kr&aacute;l.
</li>
</ul>
</p>
<h2><a name="boost_1_91">Boost 1.91 release</a></h2>
<p>
@@ -863,9 +846,9 @@ Acknowledgements
<br>
<p>Revised June 27th 2026</p>
<p>Revised November 7th 2025</p>
<p>&copy; Copyright 2003-2026 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
<p>&copy; Copyright 2003-2025 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
Distributed under the Boost Software
License, Version 1.0. (See accompanying file <a href="../../../LICENSE_1_0.txt">
LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
+3 -3
View File
@@ -201,7 +201,7 @@ than strictly required by the C++ standard, as explained in detail in the
An important type of non-standard allocators supported are those provided by the
<a href="../../../interprocess/index.html">Boost Interprocess Library</a>;
this opens up the possibility of placing <code>multi_index_container</code>s
and their iterators in shared memory.
in shared memory.
</p>
<blockquote><pre>
@@ -340,9 +340,9 @@ Debugging support
<br>
<p>Revised June 27th 2026</p>
<p>Revised July 17th 2007</p>
<p>&copy; Copyright 2003-2026 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
<p>&copy; Copyright 2003-2007 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
Distributed under the Boost Software
License, Version 1.0. (See accompanying file <a href="../../../../LICENSE_1_0.txt">
LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
+2 -23
View File
@@ -34,7 +34,6 @@ Techniques
<li><a href="#safe_mode">Safe mode</a>
<ul>
<li><a href="#serialization_and_safe_mode">Serialization and safe mode</a></li>
<li><a href="#shared_memory_and_safe_mode">Containers placed in shared memory</a></li>
</ul>
</li>
<li><a href="#invariant_check">Invariant-checking mode</a></li>
@@ -200,26 +199,6 @@ checked value by using the following workaround:
<span class=identifier>it</span><span class=special>=</span><span class=identifier>es</span><span class=special>.</span><span class=identifier>project</span><span class=special>&lt;</span><span class=number>1</span><span class=special>&gt;(</span><span class=identifier>it</span><span class=special>);</span>
</pre></blockquote>
<h3><a name="shared_memory_and_safe_mode">Containers placed in shared memory</a></h3>
<p>
In general, safe mode <b>can't be used</b> when placing <code>multi_index_container</code>s
in shared memory for interprocess communication
(as in <a href="../examples.html#example12">this example</a>).
There are some fundamental reasons for this limitation:
<ul>
<li>
Operations from one process may invalidate or change ownership for iterators
living in non-shared memory within another process: safe-mode machinery can't
access those for bookkeeping.
</li>
<li>
Safe mode uses internal mutexes not suitable for interprocess
synchronization or persistence to a memory-mapped file.
</li>
</ul>
</p>
<h2><a name="invariant_check">Invariant-checking mode</a></h2>
<p>
@@ -261,9 +240,9 @@ Techniques
<br>
<p>Revised June 27th 2026</p>
<p>Revised May 9th 2020</p>
<p>&copy; Copyright 2003-2026 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
<p>&copy; Copyright 2003-2020 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
Distributed under the Boost Software
License, Version 1.0. (See accompanying file <a href="../../../../LICENSE_1_0.txt">
LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
+12 -12
View File
@@ -66,23 +66,23 @@ int main()
std::string text=
"En un lugar de la Mancha, de cuyo nombre no quiero acordarme, no ha "
"mucho tiempo que vivía un hidalgo de los de lanza en astillero, adarga "
"antigua, rocín flaco y galgo corredor. Una olla de algo más vaca que "
"carnero, salpicón las más noches, duelos y quebrantos los sábados, "
"lantejas los viernes, algún palomino de añadidura los domingos, "
"consumían las tres partes de su hacienda. El resto della concluían sayo "
"mucho tiempo que vivía un hidalgo de los de lanza en astillero, adarga "
"antigua, rocín flaco y galgo corredor. Una olla de algo más vaca que "
"carnero, salpicón las más noches, duelos y quebrantos los sábados, "
"lantejas los viernes, algún palomino de añadidura los domingos, "
"consumían las tres partes de su hacienda. El resto della concluían sayo "
"de velarte, calzas de velludo para las fiestas, con sus pantuflos de lo "
"mesmo, y los días de entresemana se honraba con su vellorí de lo más "
"fino. Tenía en su casa una ama que pasaba de los cuarenta, y una "
"mesmo, y los días de entresemana se honraba con su vellorí de lo más "
"fino. Tenía en su casa una ama que pasaba de los cuarenta, y una "
"sobrina que no llegaba a los veinte, y un mozo de campo y plaza, que "
"así ensillaba el rocín como tomaba la podadera. Frisaba la edad de "
"nuestro hidalgo con los cincuenta años; era de complexión recia, seco "
"así ensillaba el rocín como tomaba la podadera. Frisaba la edad de "
"nuestro hidalgo con los cincuenta años; era de complexión recia, seco "
"de carnes, enjuto de rostro, gran madrugador y amigo de la caza. "
"Quieren decir que tenía el sobrenombre de Quijada, o Quesada, que en "
"Quieren decir que tenía el sobrenombre de Quijada, o Quesada, que en "
"esto hay alguna diferencia en los autores que deste caso escriben; "
"aunque, por conjeturas verosímiles, se deja entender que se llamaba "
"aunque, por conjeturas verosímiles, se deja entender que se llamaba "
"Quejana. Pero esto importa poco a nuestro cuento; basta que en la "
"narración dél no se salga un punto de la verdad.";
"narración dél no se salga un punto de la verdad.";
/* feed the text into the container */
+2 -1
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of use of Boost.Interprocess allocators.
*
* Copyright 2003-2026 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)
@@ -10,6 +10,7 @@
#if !defined(NDEBUG)
#define BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING
#define BOOST_MULTI_INDEX_ENABLE_SAFE_MODE
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 Joaquin M Lopez Munoz.
/* Copyright 2003-2023 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,6 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/multi_index/detail/raw_ptr.hpp>
#include <boost/operators.hpp>
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
@@ -78,7 +77,7 @@ public:
template<class Archive>
void save(Archive& ar,const unsigned int)const
{
node_base_type* bnode=get_node();
node_base_type* bnode=node;
ar<<core::make_nvp("pointer",bnode);
}
@@ -87,7 +86,7 @@ public:
{
node_base_type* bnode;
ar>>core::make_nvp("pointer",bnode);
node=typename Node::pointer(static_cast<Node*>(bnode));
node=static_cast<Node*>(bnode);
}
#endif
@@ -95,10 +94,10 @@ public:
typedef Node node_type;
Node* get_node()const{return raw_ptr<Node*>(node);}
Node* get_node()const{return node;}
private:
typename Node::pointer node;
Node* node;
};
template<typename Node>
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 Joaquin M Lopez Munoz.
/* Copyright 2003-2023 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,6 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/multi_index/detail/raw_ptr.hpp>
#include <boost/operators.hpp>
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
@@ -77,7 +76,7 @@ public:
template<class Archive>
void save(Archive& ar,const unsigned int)const
{
node_base_type* bnode=get_node();
node_base_type* bnode=node;
ar<<core::make_nvp("pointer",bnode);
}
@@ -93,7 +92,7 @@ public:
{
node_base_type* bnode;
ar>>core::make_nvp("pointer",bnode);
node=typename Node::pointer(static_cast<Node*>(bnode));
node=static_cast<Node*>(bnode);
if(version<1){
BucketArray* throw_away; /* consume unused ptr */
ar>>core::make_nvp("pointer",throw_away);
@@ -106,13 +105,13 @@ public:
{
node_base_type* bnode;
ar>>core::make_nvp("pointer",bnode);
node=typename Node::pointer(static_cast<Node*>(bnode));
node=static_cast<Node*>(bnode);
if(version<1){
BucketArray* buckets;
ar>>core::make_nvp("pointer",buckets);
if(buckets&&bnode&&node->impl()==buckets->end()->prior()){
if(buckets&&node&&node->impl()==buckets->end()->prior()){
/* end local_iterators used to point to end node, now they are null */
node=typename Node::pointer(0);
node=0;
}
}
}
@@ -122,7 +121,7 @@ public:
typedef Node node_type;
Node* get_node()const{return raw_ptr<Node*>(node);}
Node* get_node()const{return node;}
private:
@@ -136,7 +135,7 @@ private:
Node::template increment_local<IndexCategory>(node);
}
typename Node::pointer node;
Node* node;
};
template<
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 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)
@@ -712,13 +712,6 @@ public:
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::difference_type difference_type;
typedef allocator_rebind_t<
typename trampoline::impl_allocator_type,
hashed_index_node> final_allocator_type;
typedef allocator_pointer_t<
final_allocator_type> pointer;
typedef allocator_const_pointer_t<
final_allocator_type> const_pointer;
template<typename Category>
struct node_alg{
@@ -761,15 +754,15 @@ public:
/* interoperability with hashed_index_iterator */
template<typename Category>
static void increment(pointer& x)
static void increment(hashed_index_node*& x)
{
x=pointer(from_impl(node_alg<Category>::type::after(x->impl())));
x=from_impl(node_alg<Category>::type::after(x->impl()));
}
template<typename Category>
static void increment_local(pointer& x)
static void increment_local(hashed_index_node*& x)
{
x=pointer(from_impl(node_alg<Category>::type::after_local(x->impl())));
x=from_impl(node_alg<Category>::type::after_local(x->impl()));
}
};
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 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)
@@ -85,16 +85,10 @@ private:
typedef allocator_size_type_t<Allocator> size_type;
protected:
explicit index_base(
const ctor_args_list&,const Allocator&,index_node_type*){}
explicit index_base(const ctor_args_list&,const Allocator&){}
index_base(
const index_base<Value,IndexSpecifierList,Allocator>&,
const Allocator&,index_node_type*){}
index_base(
const index_base<Value,IndexSpecifierList,Allocator>&,
const Allocator&,index_node_type*,
do_not_copy_elements_tag)
{}
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 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)
@@ -707,10 +707,8 @@ public:
}
protected:
ordered_index_impl(
const ctor_args_list& args_list,
const allocator_type& al,index_node_type* h):
super(args_list.get_tail(),al,h),
ordered_index_impl(const ctor_args_list& args_list,const allocator_type& al):
super(args_list.get_tail(),al),
key(tuples::get<0>(args_list.get_head())),
comp_(tuples::get<1>(args_list.get_head()))
@@ -724,9 +722,8 @@ protected:
ordered_index_impl(
const ordered_index_impl<
KeyFromValue,Compare,SuperMeta,TagList,Category,AugmentPolicy>& x,
const allocator_type& al,index_node_type* h):
super(x,al,h),
KeyFromValue,Compare,SuperMeta,TagList,Category,AugmentPolicy>& x):
super(x),
key(x.key),
comp_(x.comp_)
@@ -743,9 +740,8 @@ protected:
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,al,h,do_not_copy_elements_tag()),
super(x,do_not_copy_elements_tag()),
key(x.key),
comp_(x.comp_)
@@ -1516,10 +1512,6 @@ 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;
@@ -1545,18 +1537,13 @@ public:
protected:
ordered_index(
const ctor_args_list& args_list,
const allocator_type& al,index_node_type* h):
super(args_list,al,h){}
const ctor_args_list& args_list,const allocator_type& al):
super(args_list,al){}
ordered_index(
const ordered_index& x,const allocator_type& al,index_node_type* h):
super(x,al,h){}
ordered_index(const ordered_index& x):super(x){}
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()){}
ordered_index(const ordered_index& x,do_not_copy_elements_tag):
super(x,do_not_copy_elements_tag()){}
};
#if defined(BOOST_MSVC)
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 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)
@@ -131,7 +131,6 @@ struct ordered_index_node_compressed_base
{
typedef ordered_index_node_traits<
AugmentPolicy,Allocator> node_traits;
typedef typename node_traits::allocator node_allocator;
typedef ordered_index_node_impl<
AugmentPolicy,Allocator>* pointer;
typedef const ordered_index_node_impl<
@@ -609,14 +608,6 @@ public:
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::difference_type difference_type;
typedef typename trampoline::size_type size_type;
typedef allocator_rebind_t<
typename trampoline::node_allocator,
ordered_index_node> final_allocator_type;
typedef allocator_pointer_t<
final_allocator_type> pointer;
typedef allocator_const_pointer_t<
final_allocator_type> const_pointer;
impl_color_ref color(){return trampoline::color();}
ordered_index_color color()const{return trampoline::color();}
@@ -655,24 +646,20 @@ public:
raw_ptr<const impl_type*>(x)));
}
/* Interoperability with bidir_node_iterator and index impl.
* Templated for raw-pointer/non-raw-pointer versions.
*/
/* interoperability with bidir_node_iterator */
template<typename NodePtr>
static void increment(NodePtr& x)
static void increment(ordered_index_node*& x)
{
impl_pointer xi=x->impl();
trampoline::increment(xi);
x=NodePtr(from_impl(xi));
x=from_impl(xi);
}
template<typename NodePtr>
static void decrement(NodePtr& x)
static void decrement(ordered_index_node*& x)
{
impl_pointer xi=x->impl();
trampoline::decrement(xi);
x=NodePtr(from_impl(xi));
x=from_impl(xi);
}
};
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 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)
@@ -215,18 +215,11 @@ private:
typedef random_access_index_node_trampoline<Super> trampoline;
public:
typedef typename trampoline::impl_type impl_type;
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::difference_type difference_type;
typedef typename trampoline::ptr_pointer impl_ptr_pointer;
typedef allocator_rebind_t<
typename trampoline::node_allocator,
random_access_index_node> final_allocator_type;
typedef allocator_pointer_t<
final_allocator_type> pointer;
typedef allocator_const_pointer_t<
final_allocator_type> const_pointer;
typedef typename trampoline::impl_type impl_type;
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::difference_type difference_type;
typedef typename trampoline::ptr_pointer impl_ptr_pointer;
impl_ptr_pointer& up(){return trampoline::up();}
impl_ptr_pointer up()const{return trampoline::up();}
@@ -261,25 +254,25 @@ public:
/* interoperability with rnd_node_iterator */
static void increment(pointer& x)
static void increment(random_access_index_node*& x)
{
impl_pointer xi=x->impl();
trampoline::increment(xi);
x=pointer(from_impl(xi));
x=from_impl(xi);
}
static void decrement(pointer& x)
static void decrement(random_access_index_node*& x)
{
impl_pointer xi=x->impl();
trampoline::decrement(xi);
x=pointer(from_impl(xi));
x=from_impl(xi);
}
static void advance(pointer& x,difference_type n)
static void advance(random_access_index_node*& x,difference_type n)
{
impl_pointer xi=x->impl();
trampoline::advance(xi,n);
x=pointer(from_impl(xi));
x=from_impl(xi);
}
static difference_type distance(
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 Joaquin M Lopez Munoz.
/* Copyright 2003-2023 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,6 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/multi_index/detail/raw_ptr.hpp>
#include <boost/operators.hpp>
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
@@ -88,7 +87,7 @@ public:
template<class Archive>
void save(Archive& ar,const unsigned int)const
{
node_base_type* bnode=get_node();
node_base_type* bnode=node;
ar<<core::make_nvp("pointer",bnode);
}
@@ -97,7 +96,7 @@ public:
{
node_base_type* bnode;
ar>>core::make_nvp("pointer",bnode);
node=typename Node::pointer(static_cast<Node*>(bnode));
node=static_cast<Node*>(bnode);
}
#endif
@@ -105,10 +104,10 @@ public:
typedef Node node_type;
Node* get_node()const{return raw_ptr<Node*>(node);}
Node* get_node()const{return node;}
private:
typename Node::pointer node;
Node* node;
};
template<typename Node>
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 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)
@@ -158,13 +158,6 @@ public:
typedef typename trampoline::pointer impl_pointer;
typedef typename trampoline::const_pointer const_impl_pointer;
typedef typename trampoline::difference_type difference_type;
typedef allocator_rebind_t<
typename trampoline::node_allocator,
sequenced_index_node> final_allocator_type;
typedef allocator_pointer_t<
final_allocator_type> pointer;
typedef allocator_const_pointer_t<
final_allocator_type> const_pointer;
impl_pointer& prior(){return trampoline::prior();}
impl_pointer prior()const{return trampoline::prior();}
@@ -199,24 +192,20 @@ public:
raw_ptr<const impl_type*>(x)));
}
/* Interoperability with bidir_node_iterator and index impl.
* Templated for raw-pointer/non-raw-pointer versions.
*/
/* interoperability with bidir_node_iterator */
template<typename NodePtr>
static void increment(NodePtr& x)
static void increment(sequenced_index_node*& x)
{
impl_pointer xi=x->impl();
trampoline::increment(xi);
x=NodePtr(from_impl(xi));
x=from_impl(xi);
}
template<typename NodePtr>
static void decrement(NodePtr& x)
static void decrement(sequenced_index_node*& x)
{
impl_pointer xi=x->impl();
trampoline::decrement(xi);
x=NodePtr(from_impl(xi));
x=from_impl(xi);
}
};
+10 -18
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 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)
@@ -735,14 +735,12 @@ public:
}
protected:
hashed_index(
const ctor_args_list& args_list,
const allocator_type& al,index_node_type* h):
super(args_list.get_tail(),al,h),
hashed_index(const ctor_args_list& args_list,const allocator_type& al):
super(args_list.get_tail(),al),
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,h->impl(),tuples::get<0>(args_list.get_head())),
buckets(al,header()->impl(),tuples::get<0>(args_list.get_head())),
mlf(1.0f)
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
@@ -754,13 +752,12 @@ protected:
}
hashed_index(
const hashed_index<KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>& x,
const allocator_type& al,index_node_type* h):
super(x,al,h),
const hashed_index<KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>& x):
super(x),
key(x.key),
hash_(x.hash_),
eq_(x.eq_),
buckets(al,h->impl(),x.buckets.size()),
buckets(x.get_allocator(),header()->impl(),x.buckets.size()),
mlf(x.mlf),
max_load(x.max_load)
@@ -776,13 +773,12 @@ protected:
hashed_index(
const hashed_index<KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>& x,
const allocator_type& al,index_node_type* h,
do_not_copy_elements_tag):
super(x,al,h,do_not_copy_elements_tag()),
super(x,do_not_copy_elements_tag()),
key(x.key),
hash_(x.hash_),
eq_(x.eq_),
buckets(al,h->impl(),0),
buckets(x.get_allocator(),header()->impl(),0),
mlf(1.0f)
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
@@ -1436,11 +1432,7 @@ private:
if(n>max_load){
size_type bc =(std::numeric_limits<size_type>::max)();
float fbc=1.0f+static_cast<float>(n)/mlf;
if(bc>fbc){
bc =(std::max)(
static_cast<size_type>(fbc),
static_cast<size_type>(bucket_count()+1));
}
if(bc>fbc)bc =static_cast<size_type>(fbc);
unchecked_rehash(bc);
}
}
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 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)
@@ -741,10 +741,9 @@ public:
protected:
random_access_index(
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)
const ctor_args_list& args_list,const allocator_type& al):
super(args_list.get_tail(),al),
ptrs(al,header()->impl(),0)
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
,safe(*this)
@@ -753,11 +752,9 @@ protected:
{
}
random_access_index(
const random_access_index<SuperMeta,TagList>& x,
const allocator_type& al,index_node_type* h):
super(x,al,h),
ptrs(al,h->impl(),x.size())
random_access_index(const random_access_index<SuperMeta,TagList>& x):
super(x),
ptrs(x.get_allocator(),header()->impl(),x.size())
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
,safe(*this)
@@ -769,11 +766,9 @@ protected:
}
random_access_index(
const random_access_index<SuperMeta,TagList>& 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)
const random_access_index<SuperMeta,TagList>& x,do_not_copy_elements_tag):
super(x,do_not_copy_elements_tag()),
ptrs(x.get_allocator(),header()->impl(),0)
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
,safe(*this)
+7 -12
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 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)
@@ -165,19 +165,14 @@ public:
}
protected:
ranked_index(
const ranked_index& x,const allocator_type& al,index_node_type* h):
super(x,al,h){};
ranked_index(const ranked_index& x):super(x){};
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,index_node_type* h):
super(args_list,al,h){}
const ctor_args_list& args_list,const allocator_type& al):
super(args_list,al){}
private:
template<typename LowerBounder,typename UpperBounder>
+7 -13
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 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)
@@ -655,10 +655,8 @@ public:
}
protected:
sequenced_index(
const ctor_args_list& args_list,
const allocator_type& al,index_node_type* h):
super(args_list.get_tail(),al,h)
sequenced_index(const ctor_args_list& args_list,const allocator_type& al):
super(args_list.get_tail(),al)
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
,safe(*this)
@@ -668,10 +666,8 @@ protected:
empty_initialize();
}
sequenced_index(
const sequenced_index<SuperMeta,TagList>& x,
const allocator_type& al,index_node_type* h):
super(x,al,h)
sequenced_index(const sequenced_index<SuperMeta,TagList>& x):
super(x)
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
,safe(*this)
@@ -682,10 +678,8 @@ protected:
}
sequenced_index(
const sequenced_index<SuperMeta,TagList>& x,
const allocator_type& al,index_node_type* h,
do_not_copy_elements_tag):
super(x,al,h,do_not_copy_elements_tag())
const sequenced_index<SuperMeta,TagList>& x,do_not_copy_elements_tag):
super(x,do_not_copy_elements_tag())
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
,safe(*this)
+18 -18
View File
@@ -1,6 +1,6 @@
/* Multiply indexed container.
*
* Copyright 2003-2026 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)
@@ -156,7 +156,7 @@ public:
multi_index_container():
bfm_allocator(allocator_type()),
super(ctor_args_list(),bfm_allocator::member,&*bfm_header::member),
super(ctor_args_list(),bfm_allocator::member),
node_count(0)
{
BOOST_MULTI_INDEX_CHECK_INVARIANT;
@@ -166,7 +166,7 @@ public:
const ctor_args_list& args_list,
const allocator_type& al=allocator_type()):
bfm_allocator(al),
super(args_list,bfm_allocator::member,&*bfm_header::member),
super(args_list,bfm_allocator::member),
node_count(0)
{
BOOST_MULTI_INDEX_CHECK_INVARIANT;
@@ -174,7 +174,7 @@ public:
explicit multi_index_container(const allocator_type& al):
bfm_allocator(al),
super(ctor_args_list(),bfm_allocator::member,&*bfm_header::member),
super(ctor_args_list(),bfm_allocator::member),
node_count(0)
{
BOOST_MULTI_INDEX_CHECK_INVARIANT;
@@ -186,7 +186,7 @@ public:
const ctor_args_list& args_list=ctor_args_list(),
const allocator_type& al=allocator_type()):
bfm_allocator(al),
super(args_list,bfm_allocator::member,&*bfm_header::member),
super(args_list,bfm_allocator::member),
node_count(0)
{
BOOST_MULTI_INDEX_CHECK_INVARIANT;
@@ -210,7 +210,7 @@ public:
const ctor_args_list& args_list=ctor_args_list(),
const allocator_type& al=allocator_type()):
bfm_allocator(al),
super(args_list,bfm_allocator::member,&*bfm_header::member),
super(args_list,bfm_allocator::member),
node_count(0)
{
BOOST_MULTI_INDEX_CHECK_INVARIANT;
@@ -236,7 +236,8 @@ public:
bfm_allocator(
allocator_select_on_container_copy_construction(
x.bfm_allocator::member)),
super(x,bfm_allocator::member,&*bfm_header::member),
bfm_header(),
super(x),
node_count(0)
{
copy_construct_from(x);
@@ -244,9 +245,8 @@ public:
multi_index_container(multi_index_container&& x):
bfm_allocator(std::move(x.bfm_allocator::member)),
super(
x,bfm_allocator::member,&*bfm_header::member,
detail::do_not_copy_elements_tag()),
bfm_header(),
super(x,detail::do_not_copy_elements_tag()),
node_count(0)
{
BOOST_MULTI_INDEX_CHECK_INVARIANT;
@@ -258,7 +258,8 @@ public:
const multi_index_container<Value,IndexSpecifierList,Allocator>& x,
const allocator_type& al):
bfm_allocator(al),
super(x,bfm_allocator::member,&*bfm_header::member),
bfm_header(),
super(x),
node_count(0)
{
copy_construct_from(x);
@@ -267,9 +268,8 @@ public:
multi_index_container(
multi_index_container&& x,const allocator_type& al):
bfm_allocator(al),
super(
x,bfm_allocator::member,&*bfm_header::member,
detail::do_not_copy_elements_tag()),
bfm_header(),
super(x,detail::do_not_copy_elements_tag()),
node_count(0)
{
BOOST_MULTI_INDEX_CHECK_INVARIANT;
@@ -492,7 +492,8 @@ protected:
const allocator_type& al,
detail::unequal_alloc_move_ctor_tag):
bfm_allocator(al),
super(x,bfm_allocator::member,&*bfm_header::member),
bfm_header(),
super(x),
node_count(0)
{
BOOST_MULTI_INDEX_CHECK_INVARIANT_OF(x);
@@ -523,9 +524,8 @@ protected:
const multi_index_container<Value,IndexSpecifierList,Allocator>& x,
detail::do_not_copy_elements_tag):
bfm_allocator(x.bfm_allocator::member),
super(
x,bfm_allocator::member,&*bfm_header::member,
detail::do_not_copy_elements_tag()),
bfm_header(),
super(x,detail::do_not_copy_elements_tag()),
node_count(0)
{
BOOST_MULTI_INDEX_CHECK_INVARIANT;
+2 -6
View File
@@ -1,6 +1,6 @@
# Boost.MultiIndex tests Jamfile
#
# Copyright 2003-2026 Joaquín M López Muñoz.
# Copyright 2003-2025 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,7 +37,6 @@ project
<toolset>msvc:<define>_CRT_SECURE_NO_WARNINGS
<toolset>msvc:<define>_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
<toolset>msvc:<cxxflags>/wd4494
<toolset>gcc-16:<cxxflags>-fno-thread-jumps # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119321
;
obj boost_multi_index_key_supported : check_bmi_key_supported.cpp ;
@@ -53,7 +52,7 @@ test-suite "multi_index" :
[ run test_copy_assignment.cpp test_copy_assignment_main.cpp ]
[ run test_hash_ops.cpp test_hash_ops_main.cpp ]
[ run test_iterators.cpp test_iterators_main.cpp
/boost/foreach//boost_foreach ]
/boost/foreach//boost_foreach ]
[ run test_key.cpp test_key_main.cpp
: : :
[ check-target-builds boost_multi_index_key_supported
@@ -61,9 +60,6 @@ test-suite "multi_index" :
: : <build>no ] ]
[ run test_key_extractors.cpp test_key_extractors_main.cpp ]
[ run test_list_ops.cpp test_list_ops_main.cpp ]
[ run test_mmap.cpp test_mmap_main.cpp
/boost/interprocess//boost_interprocess
/boost/uuid//boost_uuid ]
[ run test_modifiers.cpp test_modifiers_main.cpp ]
[ run test_mpl_ops.cpp test_mpl_ops_main.cpp ]
[ run test_node_handling.cpp test_node_handling_main.cpp ]
+1 -3
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex test suite.
*
* Copyright 2003-2026 Joaquin M Lopez Munoz.
* 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)
@@ -21,7 +21,6 @@
#include "test_key.hpp"
#include "test_key_extractors.hpp"
#include "test_list_ops.hpp"
#include "test_mmap.hpp"
#include "test_modifiers.hpp"
#include "test_mpl_ops.hpp"
#include "test_node_handling.hpp"
@@ -50,7 +49,6 @@ int main()
test_key();
test_key_extractors();
test_list_ops();
test_mmap();
test_modifiers();
test_mpl_ops();
test_node_handling();
+2 -2
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex test for allocator awareness.
*
* Copyright 2003-2026 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)
@@ -115,7 +115,7 @@ void test_allocator_awareness_for()
BOOST_TEST(element_transfer==(&*c3.begin()==pfirst));
BOOST_TEST(!element_transfer==(c3.begin()->move_cted));
}
BOOST_IF_CONSTEXPR(Propagate||AlwaysEqual){
if(Propagate||AlwaysEqual){
container c2(c);
const move_tracker* pfirst=&*c2.begin();
container c3(root2);
-95
View File
@@ -1,95 +0,0 @@
/* Boost.MultiIndex test for memory relocatability.
*
* 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)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#include "test_mmap.hpp"
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/lightweight_test.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/file_mapping.hpp>
#include <boost/interprocess/managed_mapped_file.hpp>
#include <boost/multi_index_container.hpp>
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/ordered_index.hpp>
#include <boost/multi_index/hashed_index.hpp>
#include <boost/multi_index/ranked_index.hpp>
#include <boost/multi_index/sequenced_index.hpp>
#include <boost/multi_index/random_access_index.hpp>
#include <boost/uuid/random_generator.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <iterator>
#include <memory>
#include <string>
void test_mmap()
{
using namespace boost::multi_index;
namespace bip=boost::interprocess;
using container=multi_index_container<
int,
indexed_by<
ordered_unique<identity<int>>,
hashed_unique<identity<int>>,
ranked_unique<identity<int>>,
sequenced<>,
random_access<>
>,
bip::allocator<int,bip::managed_mapped_file::segment_manager>
>;
using iterator0=nth_index<container,0>::type::iterator;
using iterator1=nth_index<container,1>::type::iterator;
using local_iterator1=nth_index<container,1>::type::local_iterator;
using iterator2=nth_index<container,2>::type::iterator;
using iterator3=nth_index<container,3>::type::iterator;
using iterator4=nth_index<container,4>::type::iterator;
constexpr auto container_name="container";
static auto file_name_str=
std::string("./test_mmap_")+
to_string(boost::uuids::random_generator()());
static auto file_name=file_name_str.c_str();
bip::file_mapping::remove(file_name);
std::unique_ptr<bip::managed_mapped_file> pseg1(
new bip::managed_mapped_file(bip::create_only,file_name,65536));
container& c1=*pseg1->construct<container>(container_name)(
container::ctor_args_list(),
container::allocator_type(pseg1->get_segment_manager()));
for(int i=0;i<100;++i)c1.insert(i);
auto v0=**pseg1->construct<iterator0>("it0")(c1.get<0>().begin());
auto v1=**pseg1->construct<iterator1>("it1")(c1.get<1>().begin());
auto lv1=**pseg1->construct<local_iterator1>("lit1")(c1.get<1>().begin(0));
auto v2=**pseg1->construct<iterator2>("it2")(c1.get<2>().begin());
auto v3=**pseg1->construct<iterator3>("it3")(c1.get<3>().begin());
auto v4=**pseg1->construct<iterator4>("it4")(c1.get<4>().begin());
bip::managed_mapped_file seg2(bip::open_only,file_name);
pseg1=nullptr;
container& c2=*seg2.find<container>(container_name).first;
auto it0=*seg2.find<iterator0>("it0").first;
auto it1=*seg2.find<iterator1>("it1").first;
auto lit1=*seg2.find<local_iterator1>("lit1").first;
auto it2=*seg2.find<iterator2>("it2").first;
auto it3=*seg2.find<iterator3>("it3").first;
auto it4=*seg2.find<iterator4>("it4").first;
BOOST_TEST_EQ(*it0,v0);
BOOST_TEST_EQ(std::distance(it0,c2.get<0>().end()),c2.size());
BOOST_TEST_EQ(*it1,v1);
BOOST_TEST_EQ(std::distance(it1,c2.get<1>().end()),c2.size());
BOOST_TEST_EQ(*lit1,lv1);
BOOST_TEST_EQ(
std::distance(lit1,c2.get<1>().end(0)),c2.get<1>().bucket_size(0));
BOOST_TEST_EQ(*it2,v2);
BOOST_TEST_EQ(std::distance(it2,c2.get<2>().end()),c2.size());
BOOST_TEST_EQ(*it3,v3);
BOOST_TEST_EQ(std::distance(it3,c2.get<3>().end()),c2.size());
BOOST_TEST_EQ(*it4,v4);
BOOST_TEST_EQ(std::distance(it4,c2.get<4>().end()),c2.size());
}
-11
View File
@@ -1,11 +0,0 @@
/* Boost.MultiIndex test for memory relocatability.
*
* 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)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
void test_mmap();
-19
View File
@@ -1,19 +0,0 @@
/* Boost.MultiIndex test for memory relocatability.
*
* 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)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#include <boost/detail/lightweight_test.hpp>
#include "test_mmap.hpp"
int main()
{
test_mmap();
return boost::report_errors();
}