mirror of
https://github.com/boostorg/multi_index.git
synced 2026-07-21 13:23:43 +00:00
Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c810e19fc | |||
| d6932847ec | |||
| 88a418d563 | |||
| 16325e6039 | |||
| 7be686f18e | |||
| 8bdf62586f | |||
| 6fa0f070b9 | |||
| 1130b76e4b | |||
| 2e22bed967 | |||
| 88f3a9ca8b | |||
| 8e573eba2c | |||
| 2e361f8b6a | |||
| 259f87b550 | |||
| bbeb058580 | |||
| 5cd33a9a81 | |||
| 252398ac13 | |||
| 64b5247bea | |||
| bcec2c0467 | |||
| c6e0231bed | |||
| c757629a6d | |||
| 14d94f24fa | |||
| 18c8724a46 | |||
| 5f0ac92335 | |||
| c8e707ddd7 | |||
| f7d22b4de3 | |||
| c16d49acd0 | |||
| 28192c181a | |||
| 444ebbe95b | |||
| 5ecebcbc78 | |||
| 9a782276a4 | |||
| f86dce9db1 | |||
| 2448ba2a95 |
@@ -1,16 +0,0 @@
|
||||
# Boost.MultiIndex examples and tests Jamfile
|
||||
#
|
||||
# Copyright 2003-2004 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)
|
||||
#
|
||||
# See http://www.boost.org/libs/multi_index for library home page.
|
||||
|
||||
subproject libs/multi_index ;
|
||||
|
||||
# please order by name to ease maintenance
|
||||
|
||||
subinclude libs/multi_index/example ;
|
||||
subinclude libs/multi_index/test ;
|
||||
subinclude libs/multi_index/perf ;
|
||||
@@ -135,7 +135,10 @@ Maxim Yegorushkin proposed a valuable
|
||||
for ordered indices and provided figures of its impact on performance
|
||||
for containers with large numbers of elements.
|
||||
Caleb Epstein performed the tests under MSVC++ 8.0 described in the
|
||||
performance section.
|
||||
performance section. The following people have reported bugs and problems with
|
||||
previous versions and prereleases of the library: Alexei Alexandrov,
|
||||
Matías Capeletto, John Eddy, Martin Eigel, Guillaume Lazzara,
|
||||
Felipe Magno de Almeida, Julien Pervillé, Hubert Schmid, Toby Smith.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -158,7 +161,7 @@ Index
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised February 6th 2006</p>
|
||||
<p>Revised December 21st 2006</p>
|
||||
|
||||
<p>© Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
||||
+104
-63
@@ -36,7 +36,7 @@ along with suitable workarounds when available.
|
||||
<h2>Contents</h2>
|
||||
|
||||
<ul>
|
||||
<li><a href="#bcb_64">Borland C++ Builder 6.4</a></li>
|
||||
<li><a href="#bcb_64">Borland C++ Builder 6.4 and later</a></li>
|
||||
<li><a href="#comeau_433_win_vc7_71">Comeau C/C++ 4.3.3 for Windows (VC++ 7.0/7.1 backend)</a></li>
|
||||
<li><a href="#compaq_65">Compaq C++ 6.5-042 for Tru64 UNIX and later</a></li>
|
||||
<li>
|
||||
@@ -46,21 +46,40 @@ along with suitable workarounds when available.
|
||||
<li><a href="#gcc_4_darwin">Darwin GCC 4.0</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#acc_60">HP aC++ A.06.00 for HP-UX</a></li>
|
||||
<li><a href="#acc_612">HP aC++ A.06.12 for HP-UX</a></li>
|
||||
<li><a href="#va_60">IBM VisualAge C++ V6.0 for AIX</a></li>
|
||||
<li><a href="#intel_71_lin">Intel C++ Compiler for Linux 7.1 and later</a></li>
|
||||
<li><a href="#intel_em64t_81_lin">Intel C++ Compiler Extended Memory 64 Technology 8.1 for Linux</a></li>
|
||||
<li><a href="#intel_90_lin">Intel C++ Compiler for Linux 9.0 and later</a></li>
|
||||
<li><a href="#intel_7x_win">Intel C++ Compiler for Windows 32-bit 7.0/7.1</a></li>
|
||||
<li><a href="#intel_71_win_stlport_453">Intel C++ Compiler for Windows 32-bit 7.1 + STLport 4.5.3</a></li>
|
||||
<li><a href="#intel_80_win">Intel C++ Compiler for Windows 32-bit 8.0 and later</a></li>
|
||||
<li><a href="#intel_em64t_91_win">Intel C++ Compiler Extended Memory 64 Technology 9.1 for Windows</a></li>
|
||||
<li><a href="#cw_83">Metrowerks CodeWarrior 8.3</a></li>
|
||||
<li><a href="#cw_9x">Metrowerks CodeWarrior 9 and later</a></li>
|
||||
<li><a href="#msvc_60">Microsoft Visual C++ 6.0 Service Pack 5</a></li>
|
||||
<li><a href="#msvc_60_stlport_453">Microsoft Visual C++ 6.0 Service Pack 5 + STLport 4.5.3</a></li>
|
||||
<li><a href="#msvc_70">Microsoft Visual C++ 7.0</a></li>
|
||||
<li><a href="#msvc_71">Microsoft Visual C++ 7.1</a></li>
|
||||
<li><a href="#msvc_71_stlport_462">Microsoft Visual C++ 7.1 + STLport 4.6.2</a></li>
|
||||
<li><a href="#msvc_80">Microsoft Visual C++ 8.0</a></li>
|
||||
<li>
|
||||
<a href="#msvc_60">Microsoft Visual C++ 6.0 Service Pack 5</a>
|
||||
<ul>
|
||||
<li><a href="#msvc_60_stlport_453">Microsoft Visual C++ 6.0 Service Pack 5 + STLport 4.5.3 and later</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#msvc_70">Microsoft Visual C++ 7.0</a>
|
||||
<ul>
|
||||
<li><a href="#msvc_70_stlport_501">Microsoft Visual C++ 7.0 + STLport 5.0.1</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#msvc_71">Microsoft Visual C++ 7.1</a>
|
||||
<ul>
|
||||
<li><a href="#msvc_71_stlport_462">Microsoft Visual C++ 7.1 + STLport 4.6.2</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#msvc_80">Microsoft Visual C++ 8.0</a>
|
||||
<ul>
|
||||
<li><a href="#msvc_80_stlport_501">Microsoft Visual C++ 8.0 + STLport 5.0.1</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a href="#msvc_80_x86_amd64">Microsoft Visual C++ 8.0 x64 cross-compiler</a></li>
|
||||
<li><a href="#sun_11">Sun Studio 11 for Solaris</a></li>
|
||||
<li><a href="#portability">Portability techniques</a>
|
||||
<ul>
|
||||
<li><a href="#member_offset">Use of <code>member_offset</code></a></li>
|
||||
@@ -78,13 +97,12 @@ along with suitable workarounds when available.
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<h2><a name="bcb_64">Borland C++ Builder 6.4</a></h2>
|
||||
<h2><a name="bcb_64">Borland C++ Builder 6.4 and later</a></h2>
|
||||
|
||||
<p>
|
||||
Currently, Boost.MultiIndex cannot be used with BCB 6.4. The
|
||||
number of problems encountered during the tests makes it unlikely that
|
||||
future versions of the library can be made to work under
|
||||
this compiler.
|
||||
Currently, Boost.MultiIndex cannot be used with any of BCB 6.4 up to BCB 2006.
|
||||
The number of problems encountered during the tests makes it unlikely that
|
||||
future versions of the library can be made to work under these compilers.
|
||||
</p>
|
||||
|
||||
<h2><a name="comeau_433_win_vc7_71">Comeau C/C++ 4.3.3 for Windows (VC++ 7.0/7.1 backend)</a></h2>
|
||||
@@ -107,22 +125,21 @@ No problems have been detected with this compiler. Versions 6.5-042,
|
||||
No problems have been detected with several versions of this compiler
|
||||
starting from 3.2. The following versions have been explicitly tested:
|
||||
<ul>
|
||||
<li>GCC 3.2 20020903 under Linux,</li>
|
||||
<li>GCC 3.2 20020927 (prerelease) under Cygwin 1.5.7,</li>
|
||||
<li>GCC 3.2.3 under Linux, (mingw special 20030504-1) under Win32,</li>
|
||||
<li>GCC 3.3 20030304 (Apple builds 1666 and 1671) under Mac OS,</li>
|
||||
<li>GCC 3.3.3 (cygwin special) under Cygwin 1.5.7,</li>
|
||||
<li>GCC 3.3.5 under Linux,</li>
|
||||
<li>GCC 3.3.6 under Linux and Tru64 (see <a href="#gcc_tru64">below</a>),</li>
|
||||
<li>GCC 3.4.2 (mingw-special) under Win32,</li>
|
||||
<li>GCC 3.4.3 under Linux, Solaris and Tru64 (see <a href="#gcc_tru64">below</a>),</li>
|
||||
<li>GCC 3.4.4 (cygming special) under Cygwin, under Gentoo Linux PPC64, under Linux,
|
||||
under Tru64 (see <a href="#gcc_tru64">below</a>), (mingw special) under Win32,</li>
|
||||
<li>GCC 4.0.0 20041026 (Apple build 4061) under Mac OS
|
||||
(see <a href="#gcc_4_darwin">below</a>),</li>
|
||||
<li>GCC 4.0.0 under Linux, (Apple build 5026) under Mac OS,</li>
|
||||
<li>GCC 4.0.1 under Linux and Tru64 (see <a href="#gcc_tru64">below</a>),</li>
|
||||
<li>GCC 4.0.2 under Linux.</li>
|
||||
<li>GCC 3.2.3 under Linux,</li>
|
||||
<li>GCC 3.3.5 (qnx-nto) under QNX 6.3.0 and QNX 6.3.2,
|
||||
<li>GCC 3.3.6 under Linux,</li>
|
||||
<li>GCC 3.4.2 (mingw-special) under Win32,
|
||||
(mingw-special) + STLport 5.0.1 under Win32,</li>
|
||||
<li>GCC 3.4.3 under Solaris,</li>
|
||||
<li>GCC 3.4.4 under Linux and Tru64 (see <a href="#gcc_tru64">below</a>),</li>
|
||||
<li>GCC 3.4.5 under Linux and Linux x86-64, (mingw-special) under Win32,
|
||||
(mingw-special) + STLport 5.0.1 under Win32,
|
||||
(mingw-special) + STLport 5.1.0 under Win32,</li>
|
||||
<li>GCC 4.0.1 (Apple build 5250) under Mac OS,</li>
|
||||
<li>GCC 4.0.3 under Linux and Tru64 (see <a href="#gcc_tru64">below</a>),</li>
|
||||
<li>GCC 4.1.0 under Linux and Linux x86-64,</li>
|
||||
<li>GCC 4.1.1 (OpenPKG-2-STABLE) under Solaris.</li>
|
||||
</ul>
|
||||
Boost.MultiIndex does not work with versions 3.1 and prior of GCC.
|
||||
</p>
|
||||
@@ -155,7 +172,7 @@ release of GNU GCC 4.0.0, so the invariant-checking mode is available from this
|
||||
upgrade.
|
||||
</p>
|
||||
|
||||
<h2><a name="acc_60">HP aC++ A.06.00 for HP-UX</a></h2>
|
||||
<h2><a name="acc_612">HP aC++ A.06.12 for HP-UX</a></h2>
|
||||
|
||||
<p>
|
||||
No problems have been detected with this compiler.
|
||||
@@ -163,6 +180,14 @@ No problems have been detected with this compiler.
|
||||
|
||||
<h2><a name="va_60">IBM VisualAge C++ V6.0 for AIX</a></h2>
|
||||
|
||||
<p>
|
||||
<b>Note:</b> This information was last checked for Boost 1.33.1. There is a
|
||||
possibility that changes in Boost since that release have
|
||||
caused problems with this platform.
|
||||
</p>
|
||||
|
||||
<blockquote><hr></blockquote>
|
||||
|
||||
<p>
|
||||
<a href="reference/key_extraction.html#member"><code>member</code></a> not supported,
|
||||
refer to the section on
|
||||
@@ -189,17 +214,10 @@ Serialization capabilities are not available as Boost.Serialization is not
|
||||
supported on this platform.
|
||||
</p>
|
||||
|
||||
<h2><a name="intel_71_lin">Intel C++ Compiler for Linux 7.1 and later</a></h2>
|
||||
<h2><a name="intel_90_lin">Intel C++ Compiler for Linux 9.0 and later</a></h2>
|
||||
|
||||
<p>
|
||||
No problems have been detected with this compilers from version 7.1 up to 9.0.
|
||||
</p>
|
||||
|
||||
<h2><a name="intel_em64t_81_lin">Intel C++ Compiler Extended Memory 64 Technology 8.1
|
||||
for Linux</a></h2>
|
||||
|
||||
<p>
|
||||
No problems have been detected with this compiler.
|
||||
No problems have been detected with this compilers from version 9.0.
|
||||
</p>
|
||||
|
||||
<h2><a name="intel_7x_win">Intel C++ Compiler for Windows 32-bit 7.0/7.1</a></h2>
|
||||
@@ -220,15 +238,6 @@ Argument dependent lookup is enabled by adding
|
||||
<code>/Qoption,c,--arg_dep_lookup</code> to the project options.
|
||||
</p>
|
||||
|
||||
<h2><a name="intel_71_win_stlport_453">
|
||||
Intel C++ Compiler for Windows 32-bit 7.1 + STLport 4.5.3</a></h2>
|
||||
|
||||
<p>
|
||||
Boost.MultiIndex works for this configuration. The same limitations apply as
|
||||
in Intel C++ 7.1 with its original Dinkumware standard library. STLport 4.6.2 has
|
||||
also been confirmed to work correctly.
|
||||
</p>
|
||||
|
||||
<h2><a name="intel_80_win">Intel C++ Compiler for Windows 32-bit 8.0 and later</a></h2>
|
||||
|
||||
<p>
|
||||
@@ -238,7 +247,13 @@ and in particular with the serialization part of Boost.MultiIndex.
|
||||
Argument dependent lookup is enabled by adding
|
||||
<code>/Qoption,c,--arg_dep_lookup</code> to the project options.
|
||||
Other than this, Boost.MultiIndex works without problems. Compiler versions
|
||||
from 8.0 to 9.0 have been tested.
|
||||
from 8.0 to 9.1 have been tested.
|
||||
</p>
|
||||
|
||||
<h2><a name="intel_em64t_91_win">Intel C++ Compiler Extended Memory 64 Technology 9.1 for Windows</a></h2>
|
||||
|
||||
<p>
|
||||
No problems have been detected with this compiler.
|
||||
</p>
|
||||
|
||||
<h2><a name="cw_83">Metrowerks CodeWarrior 8.3</a></h2>
|
||||
@@ -469,15 +484,15 @@ The following measures can help alleviate these problems:
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<h2>
|
||||
<h3>
|
||||
<a name="msvc_60_stlport_453">Microsoft Visual C++ 6.0 Service Pack 5
|
||||
+ STLport 4.5.3</a>
|
||||
</h2>
|
||||
+ STLport 4.5.3 and later</a>
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
Boost.MultiIndex works for this configuration. The same limitations apply as
|
||||
in MSVC++ 6.0 with its original Dinkumware standard library. STLport 4.6.2 has
|
||||
also been confirmed to work correctly.
|
||||
in MSVC++ 6.0 with its original Dinkumware standard library. STLport 4.6.2 and
|
||||
5.0.1 has also been confirmed to work correctly.
|
||||
</p>
|
||||
|
||||
<blockquote><hr></blockquote>
|
||||
@@ -485,8 +500,7 @@ also been confirmed to work correctly.
|
||||
<p>
|
||||
It is not possible to use the serialization capabilities of Boost.MultiIndex
|
||||
along with the dynamic version of STLport, as some linking errors result.
|
||||
Use instead the static version of STLport. This bug is reportedly fixed in
|
||||
STLport 5.0 (in beta stage as of this writing.)
|
||||
Use instead the static version of STLport. This bug is fixed in STLport 5.0.
|
||||
</p>
|
||||
|
||||
<h2><a name="msvc_70">Microsoft Visual C++ 7.0</a></h2>
|
||||
@@ -584,19 +598,26 @@ objects of derived types. For instance:
|
||||
<span class=identifier>key_extractor</span><span class=special>(</span><span class=identifier>x</span><span class=special>);</span>
|
||||
</pre></blockquote>
|
||||
|
||||
<h3><a name="msvc_70_stlport_501">Microsoft Visual C++ 7.0 + STLport 5.0.1</a></h3>
|
||||
|
||||
<p>
|
||||
Boost.MultiIndex works for this configuration. The same issues apply as in
|
||||
MSVC++ 7.0 with its original Dinkumware standard library.
|
||||
</p>
|
||||
|
||||
<h2><a name="msvc_71">Microsoft Visual C++ 7.1</a></h2>
|
||||
|
||||
<p>
|
||||
Problems have been reported when compiling the library with the <code>/Gm</code>
|
||||
option (Enable Minimal Rebuild.) Seemingly, this is due to an
|
||||
internal defect of the compiler (see for instance
|
||||
<a href="http://lists.boost.org/MailArchives/boost-users/msg05988.php">
|
||||
<a href="http://lists.boost.org/boost-users/2004/02/5987.php">
|
||||
this mention of a similar issue</a> in the Boost Users mailing list.)
|
||||
If <code>/Gm</code> is turned off, Boost.MultiIndex compiles and runs
|
||||
without further problems.
|
||||
</p>
|
||||
|
||||
<h2><a name="msvc_71_stlport_462">Microsoft Visual C++ 7.1 + STLport 4.6.2</a></h2>
|
||||
<h3><a name="msvc_71_stlport_462">Microsoft Visual C++ 7.1 + STLport 4.6.2</a></h3>
|
||||
|
||||
<p>
|
||||
Boost.MultiIndex works for this configuration. The same issues apply as in
|
||||
@@ -606,8 +627,28 @@ MSVC++ 7.1 with its original Dinkumware standard library.
|
||||
<h2><a name="msvc_80">Microsoft Visual C++ 8.0</a></h2>
|
||||
|
||||
<p>
|
||||
No problems have been detected with this compiler. The Beta 2 version of
|
||||
this product was used for the testing.
|
||||
No problems have been detected with this compiler.
|
||||
</p>
|
||||
|
||||
<h3><a name="msvc_80_stlport_501">Microsoft Visual C++ 8.0 + STLport 5.0.1</a></h3>
|
||||
|
||||
<p>
|
||||
No problems have been detected with this configuration.
|
||||
</p>
|
||||
|
||||
<h2><a name="msvc_80_x86_amd64">Microsoft Visual C++ 8.0 x64 cross-compiler</a></h2>
|
||||
|
||||
<p>
|
||||
No problems have been detected with this compiler.
|
||||
</p>
|
||||
|
||||
<h2><a name="sun_11">Sun Studio 11 for Solaris</a></h2>
|
||||
|
||||
<p>
|
||||
No problems have been detected with this platform. The exact compiler version
|
||||
tested was Sun C++ 5.8 Patch 121017-03 2006/07/19. The option
|
||||
<code>-library=stlport4</code> was used to replace the default standard
|
||||
library with STLport.
|
||||
</p>
|
||||
|
||||
<h2><a name="portability">Portability techniques</a></h2>
|
||||
@@ -1030,7 +1071,7 @@ Performance
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised February 6th 2006</p>
|
||||
<p>Revised October 16th 2006</p>
|
||||
|
||||
<p>© Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
||||
+13
-13
@@ -397,9 +397,9 @@ which is functionally equivalent to <code>std::set<int></code>.
|
||||
<p align="center">
|
||||
<table cellspacing="0">
|
||||
<tr>
|
||||
<th width="33%">GCC 3.1.1</th>
|
||||
<th width="33%">GCC 3.4.5</th>
|
||||
<th width="33%">ICC 7.1</th>
|
||||
<th width="33%">MSVC 6.5</th>
|
||||
<th width="33%">MSVC 8.0</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">80%</td>
|
||||
@@ -457,9 +457,9 @@ which is functionally equivalent to <code>std::list<int></code>.
|
||||
<p align="center">
|
||||
<table cellspacing="0">
|
||||
<tr>
|
||||
<th width="33%">GCC 3.1.1</th>
|
||||
<th width="33%">GCC 3.4.5</th>
|
||||
<th width="33%">ICC 7.1</th>
|
||||
<th width="33%">MSVC 6.5</th>
|
||||
<th width="33%">MSVC 8.0</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">100%</td>
|
||||
@@ -512,9 +512,9 @@ The following instantiation of <code>multi_index_container</code> was tested:
|
||||
<p align="center">
|
||||
<table cellspacing="0">
|
||||
<tr>
|
||||
<th width="33%">GCC 3.1.1</th>
|
||||
<th width="33%">GCC 3.4.5</th>
|
||||
<th width="33%">ICC 7.1</th>
|
||||
<th width="33%">MSVC 6.5</th>
|
||||
<th width="33%">MSVC 8.0</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">70%</td>
|
||||
@@ -568,9 +568,9 @@ The following instantiation of <code>multi_index_container</code> was tested:
|
||||
<p align="center">
|
||||
<table cellspacing="0">
|
||||
<tr>
|
||||
<th width="33%">GCC 3.1.1</th>
|
||||
<th width="33%">GCC 3.4.5</th>
|
||||
<th width="33%">ICC 7.1</th>
|
||||
<th width="33%">MSVC 6.5</th>
|
||||
<th width="33%">MSVC 8.0</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">75%</td>
|
||||
@@ -631,9 +631,9 @@ The following instantiation of <code>multi_index_container</code> was tested:
|
||||
<p align="center">
|
||||
<table cellspacing="0">
|
||||
<tr>
|
||||
<th width="33%">GCC 3.1.1</th>
|
||||
<th width="33%">GCC 3.4.5</th>
|
||||
<th width="33%">ICC 7.1</th>
|
||||
<th width="33%">MSVC 6.5</th>
|
||||
<th width="33%">MSVC 8.0</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">66.7%</td>
|
||||
@@ -685,9 +685,9 @@ The following instantiation of <code>multi_index_container</code> was tested:
|
||||
<p align="center">
|
||||
<table cellspacing="0">
|
||||
<tr>
|
||||
<th width="33%">GCC 3.1.1</th>
|
||||
<th width="33%">GCC 3.4.5</th>
|
||||
<th width="33%">ICC 7.1</th>
|
||||
<th width="33%">MSVC 6.5</th>
|
||||
<th width="33%">MSVC 8.0</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">69.2%</td>
|
||||
@@ -749,7 +749,7 @@ Examples
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised February 6th 2006</p>
|
||||
<p>Revised May 9th 2006</p>
|
||||
|
||||
<p>© Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
||||
@@ -655,7 +655,7 @@ Consider a pair (<code>Hash</code>, <code>Pred</code>) where
|
||||
and <code>Pred</code> is a
|
||||
<a href="http://www.sgi.com/tech/stl/BinaryPredicate.html">
|
||||
<code>Binary Predicate</code></a> inducing an equivalence relation
|
||||
on <code>Key</code>, whit the additional constraint that equivalent
|
||||
on <code>Key</code>, with the additional constraint that equivalent
|
||||
keys have the same hash value.
|
||||
A triplet of types (<code>CompatibleKey</code>, <code>CompatibleHash</code>,
|
||||
<code>CompatiblePred</code>) is said to be a <i>compatible extension</i>
|
||||
@@ -804,7 +804,7 @@ load factor, and <code>bucket_count()>=n</code>.<br>
|
||||
elements contained is preserved.<br>
|
||||
<b>Complexity:</b> Average case <code>O(size())</code>, worst case
|
||||
<code>O(size(n)<sup>2</sup>)</code>.<br>
|
||||
<b>Exeption safety:</b> Strong.
|
||||
<b>Exception safety:</b> Strong.
|
||||
</blockquote>
|
||||
|
||||
<h4><a name="serialization">Serialization</a></h4>
|
||||
@@ -895,7 +895,7 @@ Sequenced indices
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised February 6th 2006</p>
|
||||
<p>Revised July 13th 2006</p>
|
||||
|
||||
<p>© Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
||||
@@ -215,7 +215,7 @@ that acts as a do-nothing identity functor.
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>typedef</span> <span class=identifier>Type</span> <span class=identifier>result_type</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// only provided if const ChainedPtr is not convertible to const Type</span>
|
||||
<span class=comment>// only provided if const ChainedPtr& is not convertible to const Type&</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>ChainedPtr</span><span class=special>></span> <span class=identifier>Type</span><span class=special>&</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>ChainedPtr</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=keyword>const</span> <span class=identifier>Type</span><span class=special>&</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>Type</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
@@ -324,7 +324,7 @@ aimed at accessing a given member of a class.
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>typedef</span> <span class=identifier>Type</span> <span class=identifier>result_type</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// only provided if const ChainedPtr is not convertible to const Class</span>
|
||||
<span class=comment>// only provided if const ChainedPtr& is not convertible to const Class&</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>ChainedPtr</span><span class=special>></span> <span class=identifier>Type</span><span class=special>&</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>ChainedPtr</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=keyword>const</span> <span class=identifier>Type</span><span class=special>&</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>Class</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
@@ -416,7 +416,7 @@ luckily enough, most compilers accept it nevertheless, so
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>typedef</span> <span class=identifier>Type</span> <span class=identifier>result_type</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// only provided if const ChainedPtr is not convertible to const Class</span>
|
||||
<span class=comment>// only provided if const ChainedPtr& is not convertible to const Class&</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>ChainedPtr</span><span class=special>></span> <span class=identifier>Type</span><span class=special>&</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>ChainedPtr</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=keyword>const</span> <span class=identifier>Type</span><span class=special>&</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>Class</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
@@ -521,7 +521,7 @@ returning as key the result of invoking a given constant member function of a cl
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>typedef</span> <span class=keyword>typename</span> <span class=identifier>remove_reference</span><span class=special><</span><span class=identifier>Type</span><span class=special>>::</span><span class=identifier>type</span> <span class=identifier>result_type</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// only provided if const ChainedPtr is not convertible to const Class</span>
|
||||
<span class=comment>// only provided if const ChainedPtr& is not convertible to const Class&</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>ChainedPtr</span><span class=special>></span> <span class=identifier>Type</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>ChainedPtr</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=identifier>Type</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>Class</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
@@ -593,7 +593,7 @@ returning as key the result of invoking a given member function of a class.
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>typedef</span> <span class=keyword>typename</span> <span class=identifier>remove_reference</span><span class=special><</span><span class=identifier>Type</span><span class=special>>::</span><span class=identifier>type</span> <span class=identifier>result_type</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// only provided if ChainedPtr is not convertible to Class</span>
|
||||
<span class=comment>// only provided if ChainedPtr& is not convertible to Class&</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>ChainedPtr</span><span class=special>></span> <span class=identifier>Type</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>ChainedPtr</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=identifier>Type</span> <span class=keyword>operator</span><span class=special>()(</span><span class=identifier>Class</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
@@ -656,7 +656,7 @@ these pointers as an additional template parameter.
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>typedef</span> <span class=keyword>typename</span> <span class=identifier>remove_reference</span><span class=special><</span><span class=identifier>Type</span><span class=special>>::</span><span class=identifier>type</span> <span class=identifier>result_type</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// only provided if const ChainedPtr is not convertible to const Class</span>
|
||||
<span class=comment>// only provided if const ChainedPtr& is not convertible to const Class&</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>ChainedPtr</span><span class=special>></span> <span class=identifier>Type</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>ChainedPtr</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=identifier>Type</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>Class</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
@@ -700,7 +700,7 @@ used for extraction.
|
||||
<span class=special>{</span>
|
||||
<span class=keyword>typedef</span> <span class=keyword>typename</span> <span class=identifier>remove_reference</span><span class=special><</span><span class=identifier>Type</span><span class=special>>::</span><span class=identifier>type</span> <span class=identifier>result_type</span><span class=special>;</span>
|
||||
|
||||
<span class=comment>// only provided if ChainedPtr is not convertible to Class</span>
|
||||
<span class=comment>// only provided if ChainedPtr& is not convertible to Class&</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>ChainedPtr</span><span class=special>></span> <span class=identifier>Type</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>ChainedPtr</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
<span class=identifier>Type</span> <span class=keyword>operator</span><span class=special>()(</span><span class=identifier>Class</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
@@ -886,7 +886,7 @@ at compile time. The returned object is of type
|
||||
<span class=keyword>const</span> <span class=identifier>key_extractor_tuple</span><span class=special>&</span> <span class=identifier>key_extractors</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
|
||||
<span class=identifier>key_extractor_tuple</span><span class=special>&</span> <span class=identifier>key_extractors</span><span class=special>()</span>
|
||||
|
||||
<span class=comment>// only provided if const ChainedPtr is not convertible to const value_type</span>
|
||||
<span class=comment>// only provided if const ChainedPtr& is not convertible to const value_type&</span>
|
||||
<span class=keyword>template</span><span class=special><</span><span class=keyword>typename</span> <span class=identifier>ChainedPtr</span><span class=special>></span>
|
||||
<span class=identifier>result_type</span> <span class=keyword>operator</span><span class=special>()(</span><span class=keyword>const</span> <span class=identifier>ChainedPtr</span><span class=special>&</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
|
||||
|
||||
@@ -2101,7 +2101,7 @@ Compiler specifics
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised February 6th 2006</p>
|
||||
<p>Revised July 13th 2006</p>
|
||||
|
||||
<p>© Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
||||
@@ -396,7 +396,7 @@ section</a>. The complexity signature of ordered indices is:
|
||||
<li>insertion: <code>i(n)=log(n)</code>,</li>
|
||||
<li>hinted insertion: <code>h(n)=1</code> (constant) if the hint element
|
||||
precedes the point of insertion, <code>h(n)=log(n)</code> otherwise,</li>
|
||||
<li>deletion: <code>d(n)=1</code> (constant),</li>
|
||||
<li>deletion: <code>d(n)=1</code> (amortized constant),</li>
|
||||
<li>replacement: <code>r(n)=1</code> (constant) if the element position does not
|
||||
change, <code>r(n)=log(n)</code> otherwise,</li>
|
||||
<li>modifying: <code>m(n)=1</code> (constant) if the element position does not
|
||||
@@ -954,7 +954,7 @@ Hashed indices
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised February 6th 2006</p>
|
||||
<p>Revised March 31st 2006</p>
|
||||
|
||||
<p>© Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
||||
@@ -1034,10 +1034,10 @@ indices with respect to <code>std::list</code>s, namely that elements of an
|
||||
<span class=identifier>multi_index_container</span><span class=special><</span>
|
||||
<span class=keyword>int</span><span class=special>,</span>
|
||||
<span class=identifier>indexed_by</span><span class=special><</span><span class=identifier>sequenced</span><span class=special><></span> <span class=special>></span>
|
||||
<span class=special>></span> <span class=identifier>s</span><span class=special>;</span> <span class=comment>// list-like container</span>
|
||||
<span class=special>></span> <span class=identifier>s</span><span class=special>;</span> <span class=comment>// list-like container</span>
|
||||
|
||||
<span class=identifier>s</span><span class=special>.</span><span class=identifier>push_front</span><span class=special>(</span><span class=number>0</span><span class=special>);</span>
|
||||
<span class=special>*(</span><span class=identifier>s</span><span class=special>.</span><span class=identifier>begin</span><span class=special>())==</span><span class=number>1</span><span class=special>;</span> <span class=comment>// ERROR: the element cannot be changed</span>
|
||||
<span class=special>*(</span><span class=identifier>s</span><span class=special>.</span><span class=identifier>begin</span><span class=special>())=</span><span class=number>1</span><span class=special>;</span> <span class=comment>// ERROR: the element cannot be changed</span>
|
||||
</pre></blockquote>
|
||||
|
||||
<p>
|
||||
@@ -1205,7 +1205,7 @@ Index types
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised February 21st 2006</p>
|
||||
<p>Revised July 13th 2006</p>
|
||||
|
||||
<p>© Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
|
||||
@@ -263,7 +263,7 @@ an equality operator.
|
||||
<p>
|
||||
Iterators to indices of a <code>multi_index_container</code> can also be
|
||||
serialized. Serialization of iterators must be done only after serializing
|
||||
its corresponding container.
|
||||
their corresponding container.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
@@ -285,9 +285,9 @@ Debugging support
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised February 6th 2006</p>
|
||||
<p>Revised February 27th 2007</p>
|
||||
|
||||
<p>© Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
<p>© Copyright 2003-2007 Joaquín M López Muñ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">
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#
|
||||
# See http://www.boost.org/libs/multi_index for library home page.
|
||||
|
||||
subproject libs/multi_index/example ;
|
||||
|
||||
exe basic
|
||||
: basic.cpp
|
||||
: <include>$(BOOST_ROOT)
|
||||
@@ -61,7 +59,6 @@ exe sequenced
|
||||
|
||||
exe serialization
|
||||
: serialization.cpp
|
||||
<lib>../../serialization/build/boost_serialization
|
||||
/boost/serialization//boost_serialization
|
||||
: <include>$(BOOST_ROOT)
|
||||
std::locale-support
|
||||
;
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Boost.MultiIndex example of member functions used as key extractors.
|
||||
*
|
||||
* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
* Copyright 2003-2006 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)
|
||||
@@ -29,8 +29,8 @@ using namespace boost::multi_index;
|
||||
|
||||
struct name_record
|
||||
{
|
||||
name_record(std::string given_name,std::string family_name):
|
||||
given_name(given_name),family_name(family_name)
|
||||
name_record(std::string given_name_,std::string family_name_):
|
||||
given_name(given_name_),family_name(family_name_)
|
||||
{}
|
||||
|
||||
std::string name()const
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Boost.MultiIndex example of serialization of a MRU list.
|
||||
*
|
||||
* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
* Copyright 2003-2006 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)
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
typedef Item item_type;
|
||||
typedef typename item_list::iterator iterator;
|
||||
|
||||
mru_list(std::size_t max_num_items):max_num_items(max_num_items){}
|
||||
mru_list(std::size_t max_num_items_):max_num_items(max_num_items_){}
|
||||
|
||||
void insert(const item_type& item)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2006 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)
|
||||
@@ -619,7 +619,7 @@ public:
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<
|
||||
is_convertible<const ChainedPtr,const value_type>,result_type>::type
|
||||
is_convertible<const ChainedPtr&,const value_type&>,result_type>::type
|
||||
#else
|
||||
result_type
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2006 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)
|
||||
@@ -34,12 +34,19 @@
|
||||
* 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)||\
|
||||
BOOST_WORKAROUND(__GNUC__,==3)&&(__GNUC_MINOR__<4)||\
|
||||
BOOST_WORKAROUND(BOOST_MSVC,==1310)||\
|
||||
BOOST_WORKAROUND(BOOST_MSVC,==1400)
|
||||
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2006 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)
|
||||
@@ -77,14 +77,14 @@ public:
|
||||
typedef typename Node::base_type node_base_type;
|
||||
|
||||
template<class Archive>
|
||||
void save(Archive& ar,const unsigned int version)const
|
||||
void save(Archive& ar,const unsigned int)const
|
||||
{
|
||||
node_base_type* bnode=node;
|
||||
ar<<serialization::make_nvp("pointer",bnode);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
void load(Archive& ar,const unsigned int version)
|
||||
void load(Archive& ar,const unsigned int)
|
||||
{
|
||||
node_base_type* bnode;
|
||||
ar>>serialization::make_nvp("pointer",bnode);
|
||||
|
||||
@@ -37,14 +37,14 @@ public:
|
||||
typedef const typename Node::value_type& reference;
|
||||
typedef std::forward_iterator_tag iterator_category;
|
||||
|
||||
duplicates_iterator(Node* node,Node* end,Predicate pred):
|
||||
node(node),begin_chunk(0),end(end),pred(pred)
|
||||
duplicates_iterator(Node* node_,Node* end_,Predicate pred_):
|
||||
node(node_),begin_chunk(0),end(end_),pred(pred_)
|
||||
{
|
||||
advance();
|
||||
}
|
||||
|
||||
duplicates_iterator(Node* end,Predicate pred):
|
||||
node(end),begin_chunk(end),end(end),pred(pred)
|
||||
duplicates_iterator(Node* end_,Predicate pred_):
|
||||
node(end_),begin_chunk(end_),end(end_),pred(pred_)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2006 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)
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
typedef typename Node::base_type node_base_type;
|
||||
|
||||
template<class Archive>
|
||||
void save(Archive& ar,const unsigned int version)const
|
||||
void save(Archive& ar,const unsigned int)const
|
||||
{
|
||||
node_base_type* bnode=node;
|
||||
ar<<serialization::make_nvp("pointer",bnode);
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
void load(Archive& ar,const unsigned int version)
|
||||
void load(Archive& ar,const unsigned int)
|
||||
{
|
||||
node_base_type* bnode;
|
||||
ar>>serialization::make_nvp("pointer",bnode);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2006 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)
|
||||
@@ -73,8 +73,6 @@ struct hashed_index_node_impl
|
||||
}
|
||||
|
||||
private:
|
||||
hashed_index_node_impl();
|
||||
|
||||
hashed_index_node_impl* next_;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2006 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)
|
||||
@@ -68,9 +68,6 @@ struct index_node_base:private pod_value_holder<Value>
|
||||
}
|
||||
|
||||
private:
|
||||
index_node_base();
|
||||
/* this class is not intended to be cted, merely allocated */
|
||||
|
||||
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
|
||||
friend class boost::serialization::access;
|
||||
|
||||
@@ -84,7 +81,6 @@ private:
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
template<typename Node,typename Value>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2007 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)
|
||||
@@ -78,8 +78,6 @@ struct ordered_index_node_std_base
|
||||
ordered_index_node_impl* right()const{return right_;}
|
||||
|
||||
private:
|
||||
ordered_index_node_std_base();
|
||||
|
||||
ordered_index_color color_;
|
||||
ordered_index_node_impl* parent_;
|
||||
ordered_index_node_impl* left_;
|
||||
@@ -93,11 +91,22 @@ private:
|
||||
* ordered_index_node_impl by 25%.
|
||||
*/
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
/* This code casts pointers to an integer type that has been computed
|
||||
* to be large enough to hold the pointer, however the metaprogramming
|
||||
* logic is not always spotted by the VC++ code analyser that issues a
|
||||
* long list of warnings.
|
||||
*/
|
||||
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4312 4311)
|
||||
#endif
|
||||
|
||||
struct ordered_index_node_compressed_base
|
||||
{
|
||||
struct color_ref
|
||||
{
|
||||
color_ref(uintptr_type* r):r(r){}
|
||||
color_ref(uintptr_type* r_):r(r_){}
|
||||
|
||||
operator ordered_index_color()const
|
||||
{
|
||||
@@ -122,7 +131,7 @@ struct ordered_index_node_compressed_base
|
||||
|
||||
struct parent_ref
|
||||
{
|
||||
parent_ref(uintptr_type* r):r(r){}
|
||||
parent_ref(uintptr_type* r_):r(r_){}
|
||||
|
||||
operator ordered_index_node_impl*()const
|
||||
{
|
||||
@@ -167,12 +176,13 @@ struct ordered_index_node_compressed_base
|
||||
ordered_index_node_impl* right()const{return right_;}
|
||||
|
||||
private:
|
||||
ordered_index_node_compressed_base();
|
||||
|
||||
uintptr_type parentcolor_;
|
||||
ordered_index_node_impl* left_;
|
||||
ordered_index_node_impl* right_;
|
||||
};
|
||||
#if defined(BOOST_MSVC)
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct ordered_index_node_impl:
|
||||
|
||||
@@ -167,8 +167,6 @@ struct random_access_index_node_impl
|
||||
}
|
||||
|
||||
private:
|
||||
random_access_index_node_impl();
|
||||
|
||||
random_access_index_node_impl** up_;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2006 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)
|
||||
@@ -99,14 +99,14 @@ public:
|
||||
typedef typename Node::base_type node_base_type;
|
||||
|
||||
template<class Archive>
|
||||
void save(Archive& ar,const unsigned int version)const
|
||||
void save(Archive& ar,const unsigned int)const
|
||||
{
|
||||
node_base_type* bnode=node;
|
||||
ar<<serialization::make_nvp("pointer",bnode);
|
||||
}
|
||||
|
||||
template<class Archive>
|
||||
void load(Archive& ar,const unsigned int version)
|
||||
void load(Archive& ar,const unsigned int)
|
||||
{
|
||||
node_base_type* bnode;
|
||||
ar>>serialization::make_nvp("pointer",bnode);
|
||||
|
||||
@@ -251,6 +251,8 @@ inline void detach_equivalent_iterators(Iterator& it)
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Container> class safe_container; /* fwd decl. */
|
||||
|
||||
} /* namespace multi_index::safe_mode */
|
||||
|
||||
namespace detail{
|
||||
@@ -308,6 +310,7 @@ BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
friend class safe_container_base;
|
||||
|
||||
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
|
||||
template<typename> friend class safe_mode::safe_container;
|
||||
template<typename Iterator> friend
|
||||
void safe_mode::detach_equivalent_iterators(Iterator&);
|
||||
#endif
|
||||
@@ -324,13 +327,20 @@ class safe_container_base:private noncopyable
|
||||
public:
|
||||
safe_container_base(){}
|
||||
|
||||
BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
friend class safe_iterator_base;
|
||||
|
||||
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
|
||||
template<typename Iterator> friend
|
||||
void safe_mode::detach_equivalent_iterators(Iterator&);
|
||||
#endif
|
||||
|
||||
~safe_container_base()
|
||||
{
|
||||
detach_all_iterators();
|
||||
}
|
||||
/* Detaches all remaining iterators, which by now will
|
||||
* be those pointing to the end of the container.
|
||||
*/
|
||||
|
||||
void detach_all_iterators()
|
||||
{
|
||||
for(safe_iterator_base* it=header.next;it;it=it->next)it->cont=0;
|
||||
header.next=0;
|
||||
}
|
||||
@@ -343,14 +353,6 @@ public:
|
||||
std::swap(header.next,x.header.next);
|
||||
}
|
||||
|
||||
BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
friend class safe_iterator_base;
|
||||
|
||||
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
|
||||
template<typename Iterator> friend
|
||||
void safe_mode::detach_equivalent_iterators(Iterator&);
|
||||
#endif
|
||||
|
||||
safe_iterator_base header;
|
||||
|
||||
#if defined(BOOST_HAS_THREADS)
|
||||
@@ -532,6 +534,23 @@ class safe_container:public detail::safe_container_base
|
||||
typedef detail::safe_container_base super;
|
||||
|
||||
public:
|
||||
void detach_dereferenceable_iterators()
|
||||
{
|
||||
typedef typename Container::iterator iterator;
|
||||
|
||||
iterator end_=static_cast<Container*>(this)->end();
|
||||
iterator *prev_,*next_;
|
||||
for(
|
||||
prev_=static_cast<iterator*>(&this->header);
|
||||
(next_=static_cast<iterator*>(prev_->next))!=0;){
|
||||
if(*next_!=end_){
|
||||
prev_->next=next_->next;
|
||||
next_->cont=0;
|
||||
}
|
||||
else prev_=next_;
|
||||
}
|
||||
}
|
||||
|
||||
void swap(safe_container<Container>& x)
|
||||
{
|
||||
super::swap(x);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2006 Joaqu匤 M L�ez Mu�z.
|
||||
* 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)
|
||||
@@ -117,8 +117,6 @@ struct sequenced_index_node_impl
|
||||
}
|
||||
|
||||
private:
|
||||
sequenced_index_node_impl();
|
||||
|
||||
sequenced_index_node_impl* prior_;
|
||||
sequenced_index_node_impl* next_;
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2006 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)
|
||||
@@ -60,7 +60,7 @@ template <typename SequencedIndex,typename Compare>
|
||||
void sequenced_index_merge(SequencedIndex& x,SequencedIndex& y,Compare comp)
|
||||
{
|
||||
typedef typename SequencedIndex::iterator iterator;
|
||||
if(x!=y){
|
||||
if(&x!=&y){
|
||||
iterator first0=x.begin(),last0=x.end();
|
||||
iterator first1=y.begin(),last1=y.end();
|
||||
while(first0!=last0&&first1!=last1){
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2007 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)
|
||||
@@ -263,20 +263,32 @@ public:
|
||||
this->final_erase_(static_cast<final_node_type*>(position++.get_node()));
|
||||
return position;
|
||||
}
|
||||
|
||||
size_type erase(key_param_type x)
|
||||
|
||||
size_type erase(key_param_type k)
|
||||
{
|
||||
BOOST_MULTI_INDEX_HASHED_INDEX_CHECK_INVARIANT;
|
||||
|
||||
size_type s=0;
|
||||
iterator it=find(x); /* caveat: relies on find() returning */
|
||||
if(it!=end()){ /* the first element */
|
||||
do{
|
||||
it=erase(it);
|
||||
++s;
|
||||
}while(it!=end()&&eq(x,key(*it)));
|
||||
size_type s=0;
|
||||
std::size_t buc=buckets.position(hash(k));
|
||||
hashed_index_node_impl* x=buckets.at(buc);
|
||||
hashed_index_node_impl* y=x->next();
|
||||
while(y!=x){
|
||||
if(eq(k,key(node_type::from_impl(y)->value()))){
|
||||
bool b;
|
||||
do{
|
||||
hashed_index_node_impl* z=y->next();
|
||||
b=z!=x&&eq(
|
||||
key(node_type::from_impl(y)->value()),
|
||||
key(node_type::from_impl(z)->value()));
|
||||
this->final_erase_(
|
||||
static_cast<final_node_type*>(node_type::from_impl(y)));
|
||||
y=z;
|
||||
++s;
|
||||
}while(b);
|
||||
break;
|
||||
}
|
||||
y=y->next();
|
||||
}
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -538,6 +550,11 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
hashed_index(
|
||||
const hashed_index<KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>& x):
|
||||
super(x),
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
safe_super(),
|
||||
#endif
|
||||
|
||||
key(x.key),
|
||||
hash(x.hash),
|
||||
eq(x.eq),
|
||||
@@ -671,7 +688,7 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
first_bucket=buckets.size();
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
safe_super::detach_all_iterators();
|
||||
safe_super::detach_dereferenceable_iterators();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2006 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)
|
||||
@@ -60,7 +60,7 @@ struct const_identity_base
|
||||
template<typename ChainedPtr>
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<is_convertible<const ChainedPtr,Type>,Type&>::type
|
||||
typename disable_if<is_convertible<const ChainedPtr&,Type&>,Type&>::type
|
||||
#else
|
||||
Type&
|
||||
#endif
|
||||
@@ -97,7 +97,8 @@ struct non_const_identity_base
|
||||
template<typename ChainedPtr>
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<is_convertible<const ChainedPtr,const Type>,Type&>::type
|
||||
typename disable_if<
|
||||
is_convertible<const ChainedPtr&,const Type&>,Type&>::type
|
||||
#else
|
||||
Type&
|
||||
#endif
|
||||
|
||||
@@ -58,7 +58,7 @@ struct const_mem_fun
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<
|
||||
is_convertible<const ChainedPtr,const Class>,Type>::type
|
||||
is_convertible<const ChainedPtr&,const Class&>,Type>::type
|
||||
#else
|
||||
Type
|
||||
#endif
|
||||
@@ -93,7 +93,7 @@ struct mem_fun
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<
|
||||
is_convertible<ChainedPtr,Class>,Type>::type
|
||||
is_convertible<ChainedPtr&,Class&>,Type>::type
|
||||
#else
|
||||
Type
|
||||
#endif
|
||||
@@ -135,7 +135,7 @@ struct const_mem_fun_explicit
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<
|
||||
is_convertible<const ChainedPtr,const Class>,Type>::type
|
||||
is_convertible<const ChainedPtr&,const Class&>,Type>::type
|
||||
#else
|
||||
Type
|
||||
#endif
|
||||
@@ -172,7 +172,7 @@ struct mem_fun_explicit
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<
|
||||
is_convertible<ChainedPtr,Class>,Type>::type
|
||||
is_convertible<ChainedPtr&,Class&>,Type>::type
|
||||
#else
|
||||
Type
|
||||
#endif
|
||||
|
||||
@@ -60,7 +60,7 @@ struct const_member_base
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<
|
||||
is_convertible<const ChainedPtr,const Class>,Type&>::type
|
||||
is_convertible<const ChainedPtr&,const Class&>,Type&>::type
|
||||
#else
|
||||
Type&
|
||||
#endif
|
||||
@@ -80,7 +80,7 @@ struct const_member_base
|
||||
return operator()(x.get());
|
||||
}
|
||||
|
||||
Type& operator()(const reference_wrapper<Class> x,int=0)const
|
||||
Type& operator()(const reference_wrapper<Class>& x,int=0)const
|
||||
{
|
||||
return operator()(x.get());
|
||||
}
|
||||
@@ -95,7 +95,7 @@ struct non_const_member_base
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<
|
||||
is_convertible<const ChainedPtr,const Class>,Type&>::type
|
||||
is_convertible<const ChainedPtr&,const Class&>,Type&>::type
|
||||
#else
|
||||
Type&
|
||||
#endif
|
||||
@@ -163,7 +163,7 @@ struct const_member_offset_base
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<
|
||||
is_convertible<const ChainedPtr,const Class>,Type&>::type
|
||||
is_convertible<const ChainedPtr&,const Class&>,Type&>::type
|
||||
#else
|
||||
Type&
|
||||
#endif
|
||||
@@ -201,7 +201,7 @@ struct non_const_member_offset_base
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
typename disable_if<
|
||||
is_convertible<const ChainedPtr,const Class>,Type&>::type
|
||||
is_convertible<const ChainedPtr&,const Class&>,Type&>::type
|
||||
#else
|
||||
Type&
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2007 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)
|
||||
@@ -467,6 +467,11 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
ordered_index(
|
||||
const ordered_index<KeyFromValue,Compare,SuperMeta,TagList,Category>& x):
|
||||
super(x),
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
safe_super(),
|
||||
#endif
|
||||
|
||||
key(x.key),
|
||||
comp(x.comp)
|
||||
{
|
||||
@@ -593,7 +598,7 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
empty_initialize();
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
safe_super::detach_all_iterators();
|
||||
safe_super::detach_dereferenceable_iterators();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1051,17 +1056,18 @@ private:
|
||||
|
||||
void rearranger(node_type* position,node_type *x)
|
||||
{
|
||||
if(!position)position=lower_bound(key(x->value())).get_node();
|
||||
if(!position||comp(key(position->value()),key(x->value()))){
|
||||
position=lower_bound(key(x->value())).get_node();
|
||||
}
|
||||
else if(comp(key(x->value()),key(position->value()))){
|
||||
/* inconsistent rearrangement */
|
||||
throw_exception(
|
||||
archive::archive_exception(
|
||||
archive::archive_exception::other_exception));
|
||||
}
|
||||
else node_type::increment(position);
|
||||
|
||||
if(position!=x){
|
||||
/* check the rearrangement is consistent */
|
||||
if(!in_place(x->value(),position,Category())){
|
||||
throw_exception(
|
||||
archive::archive_exception(
|
||||
archive::archive_exception::other_exception));
|
||||
}
|
||||
|
||||
ordered_index_node_impl::rebalance_for_erase(
|
||||
x->impl(),header()->parent(),header()->left(),header()->right());
|
||||
ordered_index_node_impl::restore(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2007 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)
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <boost/iterator/reverse_iterator.hpp>
|
||||
#include <boost/mpl/push_front.hpp>
|
||||
#include <boost/multi_index/detail/access_specifier.hpp>
|
||||
#include <boost/multi_index/detail/index_node_base.hpp>
|
||||
#include <boost/multi_index/detail/rnd_node_iterator.hpp>
|
||||
#include <boost/multi_index/detail/rnd_index_node.hpp>
|
||||
#include <boost/multi_index/detail/rnd_index_ops.hpp>
|
||||
@@ -407,7 +408,7 @@ public:
|
||||
BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(i);
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(i,x);
|
||||
BOOST_MULTI_INDEX_RND_INDEX_CHECK_INVARIANT;
|
||||
if(x==*this)relocate(position,i);
|
||||
if(&x==this)relocate(position,i);
|
||||
else{
|
||||
if(insert(position,*i).second){
|
||||
|
||||
@@ -438,7 +439,7 @@ public:
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(last,x);
|
||||
BOOST_MULTI_INDEX_CHECK_VALID_RANGE(first,last);
|
||||
BOOST_MULTI_INDEX_RND_INDEX_CHECK_INVARIANT;
|
||||
if(x==*this)relocate(position,first,last);
|
||||
if(&x==this)relocate(position,first,last);
|
||||
else{
|
||||
size_type n=0;
|
||||
BOOST_TRY{
|
||||
@@ -500,7 +501,7 @@ public:
|
||||
|
||||
void merge(random_access_index<SuperMeta,TagList>& x)
|
||||
{
|
||||
if(*this!=x){
|
||||
if(this!=&x){
|
||||
BOOST_MULTI_INDEX_RND_INDEX_CHECK_INVARIANT;
|
||||
size_type s=size();
|
||||
splice(end(),x);
|
||||
@@ -512,7 +513,7 @@ public:
|
||||
template <typename Compare>
|
||||
void merge(random_access_index<SuperMeta,TagList>& x,Compare comp)
|
||||
{
|
||||
if(*this!=x){
|
||||
if(this!=&x){
|
||||
BOOST_MULTI_INDEX_RND_INDEX_CHECK_INVARIANT;
|
||||
size_type s=size();
|
||||
splice(end(),x);
|
||||
@@ -595,6 +596,11 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
|
||||
random_access_index(const random_access_index<SuperMeta,TagList>& x):
|
||||
super(x),
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
safe_super(),
|
||||
#endif
|
||||
|
||||
ptrs(x.get_allocator(),header()->impl(),x.size())
|
||||
{
|
||||
/* The actual copying takes place in subsequent call to copy_().
|
||||
@@ -675,7 +681,7 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
ptrs.clear();
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
safe_super::detach_all_iterators();
|
||||
safe_super::detach_dereferenceable_iterators();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2005 Joaquín M López Muñoz.
|
||||
/* Copyright 2003-2007 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)
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <boost/mpl/push_front.hpp>
|
||||
#include <boost/multi_index/detail/access_specifier.hpp>
|
||||
#include <boost/multi_index/detail/bidir_node_iterator.hpp>
|
||||
#include <boost/multi_index/detail/index_node_base.hpp>
|
||||
#include <boost/multi_index/detail/safe_ctr_proxy.hpp>
|
||||
#include <boost/multi_index/detail/safe_mode.hpp>
|
||||
#include <boost/multi_index/detail/scope_guard.hpp>
|
||||
@@ -354,7 +355,7 @@ public:
|
||||
BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(i);
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(i,x);
|
||||
BOOST_MULTI_INDEX_SEQ_INDEX_CHECK_INVARIANT;
|
||||
if(x==*this){
|
||||
if(&x==this){
|
||||
if(position!=i)relink(position.get_node(),i.get_node());
|
||||
}
|
||||
else{
|
||||
@@ -387,7 +388,7 @@ public:
|
||||
BOOST_MULTI_INDEX_CHECK_IS_OWNER(last,x);
|
||||
BOOST_MULTI_INDEX_CHECK_VALID_RANGE(first,last);
|
||||
BOOST_MULTI_INDEX_SEQ_INDEX_CHECK_INVARIANT;
|
||||
if(x==*this){
|
||||
if(&x==this){
|
||||
BOOST_MULTI_INDEX_CHECK_OUTSIDE_RANGE(position,first,last);
|
||||
if(position!=last)relink(
|
||||
position.get_node(),first.get_node(),last.get_node());
|
||||
@@ -501,6 +502,11 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
|
||||
sequenced_index(const sequenced_index<SuperMeta,TagList>& x):
|
||||
super(x)
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
,safe_super()
|
||||
#endif
|
||||
|
||||
{
|
||||
/* The actual copying takes place in subsequent call to copy_().
|
||||
*/
|
||||
@@ -577,7 +583,7 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
|
||||
empty_initialize();
|
||||
|
||||
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
|
||||
safe_super::detach_all_iterators();
|
||||
safe_super::detach_dereferenceable_iterators();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Multiply indexed container.
|
||||
*
|
||||
* Copyright 2003-2006 Joaqu匤 M L�ez Mu�z.
|
||||
* Copyright 2003-2007 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)
|
||||
@@ -230,6 +230,7 @@ public:
|
||||
multi_index_container(
|
||||
const multi_index_container<Value,IndexSpecifierList,Allocator>& x):
|
||||
bfm_allocator(x.bfm_allocator::member),
|
||||
bfm_header(),
|
||||
super(x),
|
||||
node_count(0)
|
||||
{
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
# Boost.MultiIndex performance tests Jamfile
|
||||
#
|
||||
# Copyright 2003-2004 Joaquín M López Muñoz.
|
||||
# Copyright 2003-2006 Joaqu匤 M L�ez Mu�z.
|
||||
# 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.
|
||||
|
||||
subproject libs/multi_index/perf ;
|
||||
|
||||
exe test_perf
|
||||
: test_perf.cpp
|
||||
: <include>$(BOOST_ROOT)
|
||||
@@ -1,80 +0,0 @@
|
||||
# Boost.MultiIndex tests Jamfile
|
||||
#
|
||||
# Copyright 2003-2006 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)
|
||||
#
|
||||
# See http://www.boost.org/libs/multi_index for library home page.
|
||||
|
||||
subproject libs/multi_index/test ;
|
||||
|
||||
# bring in rules for testing
|
||||
|
||||
import testing ;
|
||||
|
||||
local rule special-requirements ( toolset variant : properties * )
|
||||
{
|
||||
# GCC on Tru64 has problems with long debug symbols generated by
|
||||
# Boost.MultiIndex, so we turn them off when in that platform
|
||||
|
||||
if $(UNIX) && $(OS) = OSF
|
||||
{
|
||||
switch $(toolset)
|
||||
{
|
||||
case gcc* : properties =
|
||||
[ replace-properties $(properties) : <debug-symbols>off ] ;
|
||||
}
|
||||
}
|
||||
|
||||
return $(properties) ;
|
||||
}
|
||||
|
||||
# local specialization of rule run automatically including special requirements
|
||||
|
||||
local rule local-run ( sources + : args * : input-files * : requirements *
|
||||
: name ? : default-build * : args2 * )
|
||||
{
|
||||
return [ run $(sources) : $(args) : $(input-files)
|
||||
: $(requirements) special-requirements
|
||||
: $(name) : $(default-build) : $(args2) ] ;
|
||||
}
|
||||
|
||||
# make tests run by default
|
||||
|
||||
DEPENDS all : test ;
|
||||
|
||||
# bring in Boost.Serialization rules
|
||||
|
||||
import ../../../libs/serialization/build/serialization ;
|
||||
|
||||
{
|
||||
test-suite "multi_index"
|
||||
: [ local-run test_basic.cpp test_basic_main.cpp ]
|
||||
: [ local-run test_capacity.cpp test_capacity_main.cpp ]
|
||||
: [ local-run test_comparison.cpp test_comparison_main.cpp ]
|
||||
: [ local-run test_composite_key.cpp test_composite_key_main.cpp ]
|
||||
: [ local-run test_conv_iterators.cpp test_conv_iterators_main.cpp ]
|
||||
: [ local-run test_copy_assignment.cpp test_copy_assignment_main.cpp ]
|
||||
: [ local-run test_hash_ops.cpp test_hash_ops_main.cpp ]
|
||||
: [ local-run test_iterators.cpp test_iterators_main.cpp ]
|
||||
: [ local-run test_key_extractors.cpp test_key_extractors_main.cpp ]
|
||||
: [ local-run test_list_ops.cpp test_list_ops_main.cpp ]
|
||||
: [ local-run test_modifiers.cpp test_modifiers_main.cpp ]
|
||||
: [ local-run test_mpl_ops.cpp test_mpl_ops_main.cpp ]
|
||||
: [ local-run test_observers.cpp test_observers_main.cpp ]
|
||||
: [ local-run test_projection.cpp test_projection_main.cpp ]
|
||||
: [ local-run test_range.cpp test_range_main.cpp ]
|
||||
: [ local-run test_rearrange.cpp test_rearrange_main.cpp ]
|
||||
: [ local-run test_safe_mode.cpp test_safe_mode_main.cpp ]
|
||||
: [ local-run test_serialization.cpp test_serialization1.cpp
|
||||
test_serialization2.cpp test_serialization_main.cpp
|
||||
<lib>../../serialization/build/boost_serialization
|
||||
: # args
|
||||
: # input files
|
||||
: std::locale-support toolset::require-boost-spirit-support ]
|
||||
: [ local-run test_set_ops.cpp test_set_ops_main.cpp ]
|
||||
: [ local-run test_special_set_ops.cpp test_special_set_ops_main.cpp ]
|
||||
: [ local-run test_update.cpp test_update_main.cpp ]
|
||||
;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Boost.MultiIndex test for key extractors.
|
||||
*
|
||||
* Copyright 2003-2005 Joaqu匤 M L�ez Mu�z.
|
||||
* Copyright 2003-2006 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)
|
||||
@@ -59,6 +59,7 @@ struct test_derived_class:test_class
|
||||
};
|
||||
|
||||
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(test_class)
|
||||
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(test_derived_class)
|
||||
|
||||
typedef identity<test_class> idn;
|
||||
typedef identity<const test_class> cidn;
|
||||
@@ -85,6 +86,58 @@ typedef composite_key<
|
||||
key_mf
|
||||
> ccompw_key;
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
/* testcases for problems with non-copyable classes reported at
|
||||
* http://lists.boost.org/Archives/boost/2006/04/103065.php
|
||||
*/
|
||||
|
||||
struct test_nc_class
|
||||
{
|
||||
int int_member;
|
||||
const int int_cmember;
|
||||
|
||||
bool bool_mem_fun_const()const{return true;}
|
||||
bool bool_mem_fun(){return false;}
|
||||
|
||||
test_nc_class(int i=0):int_member(i),int_cmember(i){}
|
||||
test_nc_class(int i,int j):int_member(i),int_cmember(j){}
|
||||
|
||||
bool operator==(const test_nc_class& x)const
|
||||
{
|
||||
return int_member==x.int_member&&int_cmember==x.int_cmember;
|
||||
}
|
||||
|
||||
private:
|
||||
test_nc_class(const test_nc_class&);
|
||||
};
|
||||
|
||||
struct test_nc_derived_class:test_nc_class
|
||||
{
|
||||
test_nc_derived_class(int i=0):test_nc_class(i){}
|
||||
test_nc_derived_class(int i,int j):test_nc_class(i,j){}
|
||||
};
|
||||
|
||||
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(test_nc_class)
|
||||
BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(test_nc_derived_class)
|
||||
|
||||
typedef identity<test_nc_class> nc_idn;
|
||||
typedef identity<const test_nc_class> nc_cidn;
|
||||
typedef BOOST_MULTI_INDEX_MEMBER(test_nc_class,int,int_member) nc_key_m;
|
||||
typedef BOOST_MULTI_INDEX_MEMBER(
|
||||
test_nc_class,const int,int_member) nc_ckey_m;
|
||||
typedef BOOST_MULTI_INDEX_CONST_MEM_FUN(
|
||||
test_nc_class,bool,bool_mem_fun_const) nc_key_cmf;
|
||||
typedef BOOST_MULTI_INDEX_MEM_FUN(
|
||||
test_nc_class,bool,bool_mem_fun) nc_key_mf;
|
||||
typedef composite_key<
|
||||
test_nc_class,
|
||||
nc_idn,
|
||||
nc_key_m,
|
||||
nc_ckey_m,
|
||||
nc_key_cmf
|
||||
> nc_compkey;
|
||||
#endif
|
||||
|
||||
void test_key_extractors()
|
||||
{
|
||||
idn id;
|
||||
@@ -277,6 +330,36 @@ void test_key_extractors()
|
||||
BOOST_CHECK(!k_mf(tap));
|
||||
BOOST_CHECK(!k_mf(tw));
|
||||
BOOST_CHECK(ccmpk_w(tw)==make_tuple(false));
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
/* testcases for problems with non-copyable classes reported at
|
||||
* http://lists.boost.org/Archives/boost/2006/04/103065.php
|
||||
*/
|
||||
|
||||
nc_idn nc_id;
|
||||
nc_cidn nc_cid;
|
||||
nc_key_m nc_k_m;
|
||||
nc_ckey_m nc_ck_m;
|
||||
nc_key_cmf nc_k_cmf;
|
||||
nc_key_mf nc_k_mf;
|
||||
nc_compkey nc_cmpk;
|
||||
|
||||
test_nc_derived_class nc_td(-1,0);
|
||||
|
||||
nc_id(nc_td).int_member=0;
|
||||
BOOST_CHECK(nc_id(nc_td).int_member==0);
|
||||
BOOST_CHECK(nc_cid(nc_td).int_member==0);
|
||||
|
||||
nc_k_m(&nc_td)=1;
|
||||
BOOST_CHECK(nc_k_m(&nc_td)==1);
|
||||
BOOST_CHECK(nc_ck_m(&nc_td)==1);
|
||||
|
||||
BOOST_CHECK(nc_k_cmf(nc_td));
|
||||
BOOST_CHECK(!nc_k_mf(nc_td));
|
||||
|
||||
test_nc_class nc_t(1,0);
|
||||
BOOST_CHECK(nc_cmpk(nc_td)==make_tuple(boost::cref(nc_t),1,1,true));
|
||||
#endif
|
||||
|
||||
std::list<test_class> tl;
|
||||
for(int i=0;i<20;++i)tl.push_back(test_class(i));
|
||||
|
||||
+39
-2
@@ -1,6 +1,6 @@
|
||||
/* Boost.MultiIndex test for standard list operations.
|
||||
*
|
||||
* Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
* Copyright 2003-2007 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)
|
||||
@@ -32,7 +32,7 @@ using namespace boost::multi_index;
|
||||
int v[]=check_range;\
|
||||
std::size_t size_v=sizeof(v)/sizeof(int);\
|
||||
BOOST_CHECK(std::size_t(std::distance((p).begin(),(p).end()))==size_v);\
|
||||
BOOST_CHECK(std::equal((p).begin(),(p).end(),v));\
|
||||
BOOST_CHECK(std::equal((p).begin(),(p).end(),&v[0]));\
|
||||
}
|
||||
|
||||
#undef CHECK_VOID_RANGE
|
||||
@@ -187,6 +187,43 @@ static void test_list_ops_non_unique_seq(
|
||||
|
||||
ss.unique(same_integral_div<1>());
|
||||
CHECK_EQUAL(ss,{0 _ 3 _ 6 _ 9});
|
||||
|
||||
/* testcases for bugs reported at
|
||||
* http://lists.boost.org/boost-users/2006/09/22604.php
|
||||
*/
|
||||
{
|
||||
Sequence ss,ss2;
|
||||
ss.push_back(0);
|
||||
ss2.push_back(0);
|
||||
ss.splice(ss.end(),ss2,ss2.begin());
|
||||
CHECK_EQUAL(ss,{0 _ 0});
|
||||
BOOST_CHECK(ss2.empty());
|
||||
|
||||
ss.clear();
|
||||
ss2.clear();
|
||||
ss.push_back(0);
|
||||
ss2.push_back(0);
|
||||
ss.splice(ss.end(),ss2,ss2.begin(),ss2.end());
|
||||
CHECK_EQUAL(ss,{0 _ 0});
|
||||
BOOST_CHECK(ss2.empty());
|
||||
|
||||
ss.clear();
|
||||
ss2.clear();
|
||||
ss.push_back(0);
|
||||
ss2.push_back(0);
|
||||
ss.merge(ss2);
|
||||
CHECK_EQUAL(ss,{0 _ 0});
|
||||
BOOST_CHECK(ss2.empty());
|
||||
|
||||
typedef typename Sequence::value_type value_type;
|
||||
ss.clear();
|
||||
ss2.clear();
|
||||
ss.push_back(0);
|
||||
ss2.push_back(0);
|
||||
ss.merge(ss2,std::less<value_type>());
|
||||
CHECK_EQUAL(ss,{0 _ 0});
|
||||
BOOST_CHECK(ss2.empty());
|
||||
}
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND(__MWERKS__,<=0x3003)
|
||||
|
||||
@@ -16,6 +16,37 @@
|
||||
#include "employee.hpp"
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
class always_one
|
||||
{
|
||||
public:
|
||||
always_one():n(1){}
|
||||
~always_one(){n=0;}
|
||||
|
||||
int get()const{return n;}
|
||||
|
||||
private:
|
||||
int n;
|
||||
};
|
||||
|
||||
|
||||
inline bool operator==(const always_one& x,const always_one& y)
|
||||
{
|
||||
return x.get()==y.get();
|
||||
}
|
||||
|
||||
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
|
||||
namespace boost{
|
||||
#endif
|
||||
|
||||
inline std::size_t hash_value(const always_one& x)
|
||||
{
|
||||
return static_cast<std::size_t>(x.get());
|
||||
}
|
||||
|
||||
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
|
||||
} /* namespace boost */
|
||||
#endif
|
||||
|
||||
using namespace boost::multi_index;
|
||||
|
||||
void test_modifiers()
|
||||
@@ -236,4 +267,20 @@ void test_modifiers()
|
||||
|
||||
es2.clear();
|
||||
BOOST_CHECK(es2.size()==0);
|
||||
|
||||
/* testcase for problem reported at
|
||||
* http://lists.boost.org/boost-users/2006/12/24215.php
|
||||
*/
|
||||
|
||||
multi_index_container<
|
||||
always_one,
|
||||
indexed_by<
|
||||
hashed_non_unique<identity<always_one> >
|
||||
>
|
||||
> aoc;
|
||||
|
||||
aoc.insert(always_one());
|
||||
aoc.insert(always_one());
|
||||
aoc.erase(*(aoc.begin()));
|
||||
BOOST_CHECK(aoc.empty());
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/* Boost.MultiIndex test for range().
|
||||
*
|
||||
* Copyright 2003-2004 Joaquín M López Muñoz.
|
||||
* Copyright 2003-2007 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)
|
||||
@@ -33,7 +33,7 @@ typedef int_set::iterator int_set_iterator;
|
||||
int v[]=check_range;\
|
||||
std::size_t size_v=sizeof(v)/sizeof(int);\
|
||||
BOOST_CHECK(std::size_t(std::distance((p).first,(p).second))==size_v);\
|
||||
BOOST_CHECK(std::equal((p).first,(p).second,v));\
|
||||
BOOST_CHECK(std::equal((p).first,(p).second,&v[0]));\
|
||||
}
|
||||
|
||||
#undef CHECK_VOID_RANGE
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Boost.MultiIndex test for rearrange operations.
|
||||
*
|
||||
* Copyright 2003-2006 Joaquín M López Muñoz.
|
||||
* Copyright 2003-2007 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)
|
||||
@@ -32,7 +32,7 @@ using namespace boost::multi_index;
|
||||
int v[]=check_range;\
|
||||
std::size_t size_v=sizeof(v)/sizeof(int);\
|
||||
BOOST_CHECK(std::size_t(std::distance((p).begin(),(p).end()))==size_v);\
|
||||
BOOST_CHECK(std::equal((p).begin(),(p).end(),v));\
|
||||
BOOST_CHECK(std::equal((p).begin(),(p).end(),&v[0]));\
|
||||
}
|
||||
|
||||
#undef CHECK_VOID_RANGE
|
||||
|
||||
@@ -124,6 +124,16 @@ static void local_test_safe_mode(
|
||||
i3.erase(it);
|
||||
CATCH_SAFE_MODE(safe_mode::invalid_iterator)
|
||||
|
||||
TRY_SAFE_MODE
|
||||
iterator it;
|
||||
{
|
||||
container c3;
|
||||
index_type& i3=Policy::index_from_container(c3);
|
||||
it=i3.end();
|
||||
}
|
||||
it=it;
|
||||
CATCH_SAFE_MODE(safe_mode::invalid_iterator)
|
||||
|
||||
TRY_SAFE_MODE
|
||||
iterator it;
|
||||
{
|
||||
@@ -190,6 +200,18 @@ static void local_test_safe_mode(
|
||||
i3.clear();
|
||||
it=i3.end();
|
||||
}
|
||||
|
||||
/* testcase for doppelganger bug of that discovered for STLport at
|
||||
* http://lists.boost.org/Archives/boost/2006/04/102740.php
|
||||
*/
|
||||
{
|
||||
container c3;
|
||||
index_type& i3=Policy::index_from_container(c3);
|
||||
iterator it=i3.end();
|
||||
i3.clear();
|
||||
it=it;
|
||||
BOOST_CHECK(it==i3.end());
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Policy>
|
||||
|
||||
@@ -143,6 +143,18 @@ void test_serialization2()
|
||||
m.insert(pair_of_ints(11,1));
|
||||
m.insert(pair_of_ints(10,1));
|
||||
test_serialization(m);
|
||||
|
||||
/* testcase for bug reported at
|
||||
* http://lists.boost.org/boost-users/2006/05/19362.php
|
||||
*/
|
||||
|
||||
m.clear();
|
||||
m.insert(pair_of_ints(0,0));
|
||||
m.insert(pair_of_ints(1,0));
|
||||
m.insert(pair_of_ints(2,1));
|
||||
m.insert(pair_of_ints(4,2));
|
||||
m.insert(pair_of_ints(3,2));
|
||||
test_serialization(m);
|
||||
}
|
||||
test_hashed_index_serialization();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ struct all_indices_equal_helper<0>
|
||||
{
|
||||
template<class MultiIndexContainer>
|
||||
static bool compare(
|
||||
const MultiIndexContainer& m1,const MultiIndexContainer& m2)
|
||||
const MultiIndexContainer&,const MultiIndexContainer&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user