Compare commits

..

67 Commits

Author SHA1 Message Date
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
136 changed files with 5055 additions and 3983 deletions
-486
View File
@@ -1,486 +0,0 @@
# Copyright 2022 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
local library = "multi_index";
local triggers =
{
branch: [ "master", "develop", "feature/*", "fix/*" ]
};
local ubsan = { UBSAN: '1', UBSAN_OPTIONS: 'print_stacktrace=1' };
local asan = { ASAN: '1' };
local linux_pipeline(name, image, environment, packages = "", sources = [], arch = "amd64") =
{
name: name,
kind: "pipeline",
type: "docker",
trigger: triggers,
platform:
{
os: "linux",
arch: arch
},
steps:
[
{
name: "everything",
image: image,
environment: environment,
commands:
[
'set -e',
'wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -',
] +
(if sources != [] then [ ('apt-add-repository "' + source + '"') for source in sources ] else []) +
(if packages != "" then [ 'apt-get update', 'apt-get -y install ' + packages ] else []) +
[
'export LIBRARY=' + library,
'./.drone/drone.sh',
]
}
]
};
local macos_pipeline(name, environment, xcode_version = "12.2", osx_version = "catalina", arch = "amd64") =
{
name: name,
kind: "pipeline",
type: "exec",
trigger: triggers,
platform: {
"os": "darwin",
"arch": arch
},
node: {
"os": osx_version
},
steps: [
{
name: "everything",
environment: environment + { "DEVELOPER_DIR": "/Applications/Xcode-" + xcode_version + ".app/Contents/Developer" },
commands:
[
'export LIBRARY=' + library,
'./.drone/drone.sh',
]
}
]
};
local windows_pipeline(name, image, environment, arch = "amd64") =
{
name: name,
kind: "pipeline",
type: "docker",
trigger: triggers,
platform:
{
os: "windows",
arch: arch
},
"steps":
[
{
name: "everything",
image: image,
environment: environment,
commands:
[
'cmd /C .drone\\\\drone.bat ' + library,
]
}
]
};
[
linux_pipeline(
"Linux 14.04 GCC 4.8* 32/64",
"cppalliance/droneubuntu1404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11', ADDRMD: '32,64' },
),
linux_pipeline(
"Linux 14.04 GCC 4.9 32/64",
"cppalliance/droneubuntu1404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '11', ADDRMD: '32,64' },
"g++-4.9-multilib",
[ "ppa:ubuntu-toolchain-r/test" ],
),
linux_pipeline(
"Linux 16.04 GCC 5* 32/64",
"cppalliance/droneubuntu1604:1",
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14', ADDRMD: '32,64' },
),
linux_pipeline(
"Linux 18.04 GCC 6 32/64",
"cppalliance/droneubuntu1804:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-6', CXXSTD: '11,14', ADDRMD: '32,64' },
"g++-6-multilib",
),
linux_pipeline(
"Linux 18.04 GCC 7* 32/64",
"cppalliance/droneubuntu1804:1",
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17', ADDRMD: '32,64' },
),
linux_pipeline(
"Linux 18.04 GCC 8 32/64",
"cppalliance/droneubuntu1804:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-8', CXXSTD: '11,14,17', ADDRMD: '32,64' },
"g++-8-multilib",
),
linux_pipeline(
"Linux 20.04 GCC 9* 32/64",
"cppalliance/droneubuntu2004:1",
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a', ADDRMD: '32,64' },
),
linux_pipeline(
"Linux 20.04 GCC 9* ARM64",
"cppalliance/droneubuntu2004:multiarch",
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' },
arch="arm64",
),
linux_pipeline(
"Linux 20.04 GCC 9* S390x",
"cppalliance/droneubuntu2004:multiarch",
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' },
arch="s390x",
),
linux_pipeline(
"Linux 20.04 GCC 10 32/64",
"cppalliance/droneubuntu2004:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '11,14,17,20', ADDRMD: '32,64' },
"g++-10-multilib",
),
linux_pipeline(
"Linux 22.04 GCC 11* 32/64",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a', ADDRMD: '32,64' },
),
linux_pipeline(
"Linux 22.04 GCC 12 32/64 C++11-14",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11,14', ADDRMD: '32,64' },
"g++-12-multilib",
),
linux_pipeline(
"Linux 22.04 GCC 12 32/64 C++17-20",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '17,20', ADDRMD: '32,64' },
"g++-12-multilib",
),
linux_pipeline(
"Linux 22.04 GCC 12 32/64",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '2b', ADDRMD: '32,64' },
"g++-12-multilib",
),
linux_pipeline(
"Linux 23.04 GCC 13 32/64 UBSAN C++11-14",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14', ADDRMD: '32,64' } + ubsan,
"g++-13-multilib",
),
linux_pipeline(
"Linux 23.04 GCC 13 32/64 UBSAN C++17-20",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '17,20', ADDRMD: '32,64' } + ubsan,
"g++-13-multilib",
),
linux_pipeline(
"Linux 23.04 GCC 13 32/64 UBSAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '2b', ADDRMD: '32,64' } + ubsan,
"g++-13-multilib",
),
linux_pipeline(
"Linux 23.04 GCC 13 32 ASAN C++11-14",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14', ADDRMD: '32' } + asan,
"g++-13-multilib",
),
linux_pipeline(
"Linux 23.04 GCC 13 32 ASAN C++17-20",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '17,20', ADDRMD: '32' } + asan,
"g++-13-multilib",
),
linux_pipeline(
"Linux 23.04 GCC 13 32 ASAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '2b', ADDRMD: '32' } + asan,
"g++-13-multilib",
),
linux_pipeline(
"Linux 24.04 GCC 14 UBSAN C++11-14",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14' } + ubsan,
"g++-14-multilib",
),
linux_pipeline(
"Linux 24.04 GCC 14 UBSAN C++17-20",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '17,20' } + ubsan,
"g++-14-multilib",
),
linux_pipeline(
"Linux 24.04 GCC 14 UBSAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '2b' } + ubsan,
"g++-14-multilib",
),
linux_pipeline(
"Linux 24.04 GCC 14 ASAN C++11-14",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14' } + asan,
"g++-14-multilib",
),
linux_pipeline(
"Linux 24.04 GCC 14 ASAN C++17-20",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '17,20' } + asan,
"g++-14-multilib",
),
linux_pipeline(
"Linux 24.04 GCC 14 ASAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '2b' } + asan,
"g++-14-multilib",
),
linux_pipeline(
"Linux 16.04 Clang 3.5",
"cppalliance/droneubuntu1604:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '11' },
"clang-3.5",
),
linux_pipeline(
"Linux 16.04 Clang 3.6",
"cppalliance/droneubuntu1604:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-3.6', CXXSTD: '11,14' },
"clang-3.6",
),
linux_pipeline(
"Linux 16.04 Clang 3.7",
"cppalliance/droneubuntu1604:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-3.7', CXXSTD: '11,14' },
"clang-3.7",
),
linux_pipeline(
"Linux 16.04 Clang 3.8",
"cppalliance/droneubuntu1604:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-3.8', CXXSTD: '11,14' },
"clang-3.8",
),
linux_pipeline(
"Linux 18.04 Clang 3.9",
"cppalliance/droneubuntu1804:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-3.9', CXXSTD: '11,14' },
"clang-3.9",
),
linux_pipeline(
"Linux 18.04 Clang 4.0",
"cppalliance/droneubuntu1804:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-4.0', CXXSTD: '11,14' },
"clang-4.0",
),
linux_pipeline(
"Linux 18.04 Clang 5.0",
"cppalliance/droneubuntu1804:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '11,14' },
"clang-5.0",
),
linux_pipeline(
"Linux 18.04 Clang 6.0",
"cppalliance/droneubuntu1804:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-6.0', CXXSTD: '11,14,17' },
"clang-6.0",
),
linux_pipeline(
"Linux 20.04 Clang 7",
"cppalliance/droneubuntu2004:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-7', CXXSTD: '11,14,17' },
"clang-7",
),
linux_pipeline(
"Linux 20.04 Clang 8",
"cppalliance/droneubuntu2004:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-8', CXXSTD: '11,14,17' },
"clang-8",
),
linux_pipeline(
"Linux 20.04 Clang 9",
"cppalliance/droneubuntu2004:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-9', CXXSTD: '11,14,17,2a' },
"clang-9",
),
linux_pipeline(
"Linux 20.04 Clang 10",
"cppalliance/droneubuntu2004:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-10', CXXSTD: '11,14,17,2a' },
"clang-10",
),
linux_pipeline(
"Linux 20.04 Clang 11",
"cppalliance/droneubuntu2004:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-11', CXXSTD: '11,14,17,2a' },
"clang-11",
),
linux_pipeline(
"Linux 20.04 Clang 12",
"cppalliance/droneubuntu2004:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-12', CXXSTD: '11,14,17,2a' },
"clang-12",
),
linux_pipeline(
"Linux 22.04 Clang 13",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '11,14,17,20' },
"clang-13",
),
linux_pipeline(
"Linux 22.04 Clang 14",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '11,14,17,20,2b' },
"clang-14",
),
linux_pipeline(
"Linux 22.04 Clang 15",
"cppalliance/droneubuntu2204:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '11,14,17,20,2b' },
"clang-15",
),
linux_pipeline(
"Linux 23.04 Clang 16",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '11,14,17,20,2b' },
"clang-16",
),
linux_pipeline(
"Linux 23.10 Clang 17 UBSAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan,
"clang-17",
),
linux_pipeline(
"Linux 23.10 Clang 17 ASAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + asan,
"clang-17",
),
linux_pipeline(
"Linux 24.04 Clang 18 UBSAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + ubsan,
"clang-18",
),
linux_pipeline(
"Linux 24.04 Clang 18 ASAN",
"cppalliance/droneubuntu2404:1",
{ TOOLSET: 'clang', COMPILER: 'clang++-18', CXXSTD: '11,14,17,20,2b' } + asan,
"clang-18",
),
macos_pipeline(
"MacOS 10.15 Xcode 12.2 UBSAN (11,14)",
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14' } + ubsan,
),
macos_pipeline(
"MacOS 10.15 Xcode 12.2 UBSAN (17,2a)",
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '17,2a' } + ubsan,
),
macos_pipeline(
"MacOS 10.15 Xcode 12.2 ASAN (11,14)",
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14' } + asan,
),
macos_pipeline(
"MacOS 10.15 Xcode 12.2 ASAN (17,2a)",
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '17,2a' } + asan,
),
macos_pipeline(
"MacOS 12.4 Xcode 13.4.1 UBSAN",
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,20,2b', LINK: 'static' } + ubsan,
xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64",
),
macos_pipeline(
"MacOS 12.4 Xcode 13.4.1 ASAN",
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,20,2b' } + asan,
xcode_version = "13.4.1", osx_version = "monterey", arch = "arm64",
),
windows_pipeline(
"Windows VS2015 msvc-14.0",
"cppalliance/dronevs2015",
{ TOOLSET: 'msvc-14.0', CXXSTD: '14,latest', B2_DONT_EMBED_MANIFEST: '1' },
),
windows_pipeline(
"Windows VS2017 msvc-14.1",
"cppalliance/dronevs2017",
{ TOOLSET: 'msvc-14.1', CXXSTD: '14,17,latest' },
),
windows_pipeline(
"Windows VS2019 msvc-14.2",
"cppalliance/dronevs2019",
{ TOOLSET: 'msvc-14.2', CXXSTD: '14,17,20,latest' },
),
windows_pipeline(
"Windows VS2022 msvc-14.3",
"cppalliance/dronevs2022:1",
{ TOOLSET: 'msvc-14.3', CXXSTD: '14,17,20,latest' },
),
]
+47
View File
@@ -0,0 +1,47 @@
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt)
#
# Copyright Rene Rivera 2020.
# For Drone CI we use the Starlark scripting language to reduce duplication.
# As the yaml syntax for Drone CI is rather limited.
#
#
globalenv={}
linuxglobalimage="cppalliance/droneubuntu1404:1"
windowsglobalimage="cppalliance/dronevs2019"
def main(ctx):
return [
linux_cxx("TOOLSET=gcc COMPILER=g++ CXXSTD=03,11 Job 0", "g++", packages="", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': 'b6589fc6ab'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x Job 1", "g++", packages="g++-4.4", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.4', 'CXXSTD': '98,0x', 'DRONE_JOB_UUID': '356a192b79'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x Job 2", "g++", packages="g++-4.6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.6', 'CXXSTD': '03,0x', 'DRONE_JOB_UUID': 'da4b9237ba'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11 Job 3", "g++-4.7", packages="g++-4.7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.7', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': '77de68daec'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11 Job 4", "g++-4.8", packages="g++-4.8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.8', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': '1b64538924'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11 Job 5", "g++-4.9", packages="g++-4.9", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-4.9', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': 'ac3478d69a'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z Job 6", "g++-5", packages="g++-5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-5', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': 'c1dfd96eea'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z Job 7", "g++-6", packages="g++-6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-6', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': '902ba3cda1'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 Job 8", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '03,11,14,17', 'DRONE_JOB_UUID': 'fe5dbbcea5'}, globalenv=globalenv),
linux_cxx("TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17 Job 9", "g++-8", packages="g++-8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'gcc', 'COMPILER': 'g++-8', 'CXXSTD': '03,11,14,17,2a', 'DRONE_JOB_UUID': '0ade7c2cf9'}, globalenv=globalenv),
linux_cxx("UBSAN=1 TOOLSET=gcc COMPILER=g++-7 CXXSTD=03, Job 10", "g++-7", packages="g++-7", buildtype="boost", image=linuxglobalimage, environment={'UBSAN': '1', 'TOOLSET': 'gcc', 'COMPILER': 'g++-7', 'CXXSTD': '03,11,14,17', 'UBSAN_OPTIONS': 'print_stacktrace=1', 'LINKFLAGS': '-fuse-ld=gold', 'DRONE_JOB_UUID': 'b1d5781111'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=03,11 Job 11", "clang++", packages="", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': '17ba079149'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=/usr/bin/clang++ CXXST Job 12", "/usr/bin/clang++", packages="clang-3.3", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': '/usr/bin/clang++', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': '7b52009b64'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=/usr/bin/clang++ CXXST Job 13", "/usr/bin/clang++", packages="clang-3.4", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': '/usr/bin/clang++', 'CXXSTD': '03,11', 'DRONE_JOB_UUID': 'bd307a3ec3'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03, Job 14", "clang++", packages="clang-3.5 libstdc++-4.9-dev", llvm_os="precise", llvm_ver="3.5", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.5', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': 'fa35e19212'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03, Job 15", "clang++", packages="clang-3.6", llvm_os="precise", llvm_ver="3.6", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.6', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': 'f1abd67035'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03, Job 16", "clang++", packages="clang-3.7", llvm_os="precise", llvm_ver="3.7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.7', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': '1574bddb75'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03, Job 17", "clang++-3.8", packages="clang-3.8 libstdc++-4.9-dev", llvm_os="precise", llvm_ver="3.8", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.8', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': '0716d9708d'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03, Job 18", "clang++-3.9", packages="clang-3.9 libstdc++-4.9-dev", llvm_os="precise", llvm_ver="3.9", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-3.9', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': '9e6a55b6b4'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03, Job 19", "clang++-4.0", packages="clang-4.0", llvm_os="trusty", llvm_ver="4.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-4.0', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': 'b3f0c7f6bb'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03, Job 20", "clang++-5.0", packages="clang-5.0", llvm_os="trusty", llvm_ver="5.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-5.0', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': '91032ad7bb'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03, Job 21", "clang++-6.0", packages="clang-6.0", llvm_os="trusty", llvm_ver="6.0", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-6.0', 'CXXSTD': '03,11,14,17,2a', 'DRONE_JOB_UUID': '472b07b9fc'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-7 CXXSTD=03,11 Job 22", "clang++-7", packages="clang-7", llvm_os="trusty", llvm_ver="7", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '03,11,14,17,2a', 'DRONE_JOB_UUID': '12c6fc06c9'}, globalenv=globalenv),
linux_cxx("UBSAN=1 TOOLSET=clang COMPILER=clang++-7 CXXS Job 23", "clang++-7", packages="clang-7 libstdc++-5-dev", llvm_os="trusty", llvm_ver="7", buildtype="boost", image=linuxglobalimage, environment={'UBSAN': '1', 'TOOLSET': 'clang', 'COMPILER': 'clang++-7', 'CXXSTD': '03,11,14,17,2a', 'UBSAN_OPTIONS': 'print_stacktrace=1', 'DRONE_JOB_UUID': 'd435a6cdd7'}, globalenv=globalenv),
linux_cxx("TOOLSET=clang COMPILER=clang++-libc++ CXXSTD= Job 24", "clang++-libc++", packages="libc++-dev", buildtype="boost", image=linuxglobalimage, environment={'TOOLSET': 'clang', 'COMPILER': 'clang++-libc++', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_UUID': '4d134bc072'}, globalenv=globalenv),
linux_cxx("UBSAN=1 TOOLSET=clang COMPILER=clang++-libc++ Job 25", "clang++-libc++", packages="libc++-dev", buildtype="boost", image=linuxglobalimage, environment={'UBSAN': '1', 'TOOLSET': 'clang', 'COMPILER': 'clang++-libc++', 'CXXSTD': '03,11,14,1z', 'UBSAN_OPTIONS': 'print_stacktrace=1', 'DRONE_JOB_UUID': 'f6e1126ced'}, globalenv=globalenv),
osx_cxx("TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,1 Job 26", "clang++", packages="", buildtype="boost", environment={'TOOLSET': 'clang', 'COMPILER': 'clang++', 'CXXSTD': '03,11,14,1z', 'DRONE_JOB_OS_NAME': 'osx', 'DRONE_JOB_UUID': '887309d048'}, globalenv=globalenv),
]
# from https://github.com/boostorg/boost-ci
load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
+38
View File
@@ -0,0 +1,38 @@
#!/bin/bash
set -ex
export TRAVIS_BUILD_DIR=$(pwd)
export DRONE_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=$DRONE_BRANCH
export VCS_COMMIT_ID=$DRONE_COMMIT
export GIT_COMMIT=$DRONE_COMMIT
export PATH=~/.local/bin:/usr/local/bin:$PATH
echo '==================================> BEFORE_INSTALL'
. .drone/before-install.sh
echo '==================================> INSTALL'
cd ..
git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init
git rm --ignore-unmatch libs/multi_index/
./bootstrap.sh
./b2 headers
mkdir libs/multi_index
cp -r $TRAVIS_BUILD_DIR/* libs/multi_index
echo '==================================> BEFORE_SCRIPT'
. $DRONE_BUILD_DIR/.drone/before-script.sh
echo '==================================> SCRIPT'
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
./b2 libs/multi_index/test toolset=$TOOLSET cxxstd=$CXXSTD
echo '==================================> AFTER_SUCCESS'
. $DRONE_BUILD_DIR/.drone/after-success.sh
-23
View File
@@ -1,23 +0,0 @@
@REM Copyright 2022 Peter Dimov
@REM Distributed under the Boost Software License, Version 1.0.
@REM https://www.boost.org/LICENSE_1_0.txt
@ECHO ON
set LIBRARY=%1
set DRONE_BUILD_DIR=%CD%
set BOOST_BRANCH=develop
if "%DRONE_BRANCH%" == "master" set BOOST_BRANCH=master
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init tools/boostdep
xcopy /s /e /q %DRONE_BUILD_DIR% libs\%LIBRARY%\
python tools/boostdep/depinst/depinst.py -I examples %LIBRARY%
cmd /c bootstrap
b2 -d0 headers
if not "%CXXSTD%" == "" set CXXSTD=cxxstd=%CXXSTD%
if not "%ADDRMD%" == "" set ADDRMD=address-model=%ADDRMD%
b2 -j3 libs/%LIBRARY%/test toolset=%TOOLSET% %CXXSTD% %ADDRMD% variant=debug,release embed-manifest-via=linker
-25
View File
@@ -1,25 +0,0 @@
#!/bin/bash
# Copyright 2022 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
set -ex
export PATH=~/.local/bin:/usr/local/bin:$PATH
DRONE_BUILD_DIR=$(pwd)
BOOST_BRANCH=develop
if [ "$DRONE_BRANCH" = "master" ]; then BOOST_BRANCH=master; fi
cd ..
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
git submodule update --init tools/boostdep
cp -r $DRONE_BUILD_DIR/* libs/$LIBRARY
python tools/boostdep/depinst/depinst.py -I examples $LIBRARY
./bootstrap.sh
./b2 -d0 headers
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
./b2 -j3 libs/$LIBRARY/test toolset=$TOOLSET cxxstd=$CXXSTD variant=debug,release ${ADDRMD:+address-model=$ADDRMD} ${UBSAN:+undefined-sanitizer=norecover debug-symbols=on} ${ASAN:+address-sanitizer=norecover debug-symbols=on} ${LINKFLAGS:+linkflags=$LINKFLAGS} ${LINK:+link=$LINK}
+500 -282
View File
@@ -1,4 +1,4 @@
name: CI
name: GitHub Actions CI
on:
pull_request:
@@ -6,12 +6,10 @@ on:
branches:
- master
- develop
- githubactions*
- feature/**
- fix/**
env:
UBSAN_OPTIONS: print_stacktrace=1
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
- pr/**
jobs:
posix:
@@ -19,307 +17,527 @@ jobs:
fail-fast: false
matrix:
include:
- toolset: gcc-4.8
cxxstd: "11"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-4.8-multilib
address-model: 32,64
- toolset: gcc-5
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-5-multilib
address-model: 32,64
- toolset: gcc-6
cxxstd: "11,14,1z"
container: ubuntu:18.04
os: ubuntu-latest
install: g++-6-multilib
address-model: 32,64
- toolset: gcc-7
cxxstd: "11,14,17"
container: ubuntu:20.04
os: ubuntu-latest
install: g++-7-multilib
address-model: 32,64
- toolset: gcc-8
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: g++-8-multilib
address-model: 32,64
- toolset: gcc-9
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: g++-9-multilib
address-model: 32,64
- toolset: gcc-10
cxxstd: "11,14,17,2a"
os: ubuntu-22.04
install: g++-10-multilib
address-model: 32,64
- toolset: gcc-11
cxxstd: "11,14,17,20"
os: ubuntu-22.04
install: g++-11-multilib
address-model: 32,64
- toolset: gcc-12
cxxstd: "11,14,17,20,2b"
os: ubuntu-22.04
install: g++-12-multilib
address-model: 32,64
- toolset: gcc-13
cxxstd: "11,14,17,20,2b"
os: ubuntu-24.04
install: g++-13-multilib
address-model: 32,64
- toolset: gcc-14
cxxstd: "11,14,17,20,2b"
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"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-3.9
- toolset: clang
compiler: clang++-4.0
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-4.0
- toolset: clang
compiler: clang++-5.0
cxxstd: "11,14"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-5.0
- toolset: clang
compiler: clang++-6.0
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-6.0
- toolset: clang
compiler: clang++-7
cxxstd: "11,14,17"
os: ubuntu-latest
container: ubuntu:18.04
install: clang-7
- toolset: clang
compiler: clang++-8
cxxstd: "11,14,17"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-8
- toolset: clang
compiler: clang++-9
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-9
- toolset: clang
compiler: clang++-10
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-10
- toolset: clang
compiler: clang++-11
cxxstd: "11,14,17,2a"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-11
- toolset: clang
compiler: clang++-12
cxxstd: "11,14,17,20"
container: ubuntu:20.04
os: ubuntu-latest
install: clang-12
- toolset: clang
compiler: clang++-13
cxxstd: "11,14,17,20,2b"
container: ubuntu:22.04
os: ubuntu-latest
install: clang-13
- toolset: clang
compiler: clang++-14
cxxstd: "11,14,17,20,2b"
container: ubuntu:22.04
os: ubuntu-latest
install: clang-14
- toolset: clang
compiler: clang++-15
cxxstd: "11,14,17,20,2b"
container: ubuntu:22.04
os: ubuntu-latest
install: clang-15
- toolset: clang
compiler: clang++-16
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-16
- toolset: clang
compiler: clang++-17
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-17
- toolset: clang
compiler: clang++-18
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-18
- toolset: clang
compiler: clang++-19
cxxstd: "11,14,17,20,2b"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-19
- toolset: clang
compiler: clang++-20
cxxstd: "11,14,17,20,23,2c"
container: ubuntu:24.04
os: ubuntu-latest
install: clang-20
- toolset: clang
cxxstd: "11,14,17,20,2b"
os: macos-14
- toolset: clang
cxxstd: "11,14,17,20,23,2c"
os: macos-15
- toolset: clang
cxxstd: "11,14,17,20,23,2c"
os: macos-26
- name: "TOOLSET=gcc COMPILER=g++ CXXSTD=03,11 Job 0"
buildtype: "boost"
packages: ""
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++"
cxxstd: "03,11"
- name: "TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x Job 1"
buildtype: "boost"
packages: "g++-4.4"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-4.4"
cxxstd: "98,0x"
- name: "TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x Job 2"
buildtype: "boost"
packages: "g++-4.6"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-4.6"
cxxstd: "03,0x"
- name: "TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11 Job 3"
buildtype: "boost"
packages: "g++-4.7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "g++-4.7"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-4.7"
cxxstd: "03,11"
- name: "TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11 Job 4"
buildtype: "boost"
packages: "g++-4.8"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "g++-4.8"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-4.8"
cxxstd: "03,11"
- name: "TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11 Job 5"
buildtype: "boost"
packages: "g++-4.9"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-4.9"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-4.9"
cxxstd: "03,11"
- name: "TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z Job 6"
buildtype: "boost"
packages: "g++-5"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-5"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-5"
cxxstd: "03,11,14,1z"
- name: "TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z Job 7"
buildtype: "boost"
packages: "g++-6"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "g++-6"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-6"
cxxstd: "03,11,14,1z"
- name: "TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 Job 8"
buildtype: "boost"
packages: "g++-7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-7"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-7"
cxxstd: "03,11,14,17"
- name: "TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17 Job 9"
buildtype: "boost"
packages: "g++-8"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-8"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "gcc"
compiler: "g++-8"
cxxstd: "03,11,14,17,2a"
- name: "UBSAN=1 TOOLSET=gcc COMPILER=g++-7 CXXSTD=03, Job 10"
buildtype: "boost"
packages: "g++-7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "g++-7"
sources: ""
llvm_os: ""
llvm_ver: ""
ubsan: "1"
toolset: "gcc"
compiler: "g++-7"
cxxstd: "03,11,14,17"
ubsan_options: "print_stacktrace=1"
linkflags: "-fuse-ld=gold"
- name: "TOOLSET=clang COMPILER=clang++ CXXSTD=03,11 Job 11"
buildtype: "boost"
packages: ""
packages_to_remove: ""
os: "ubuntu-18.04"
cxx: "clang++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "clang"
compiler: "clang++"
cxxstd: "03,11"
- name: "TOOLSET=clang COMPILER=/usr/bin/clang++ CXXST Job 12"
buildtype: "boost"
packages: "clang-3.3"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "/usr/bin/clang++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "clang"
compiler: "/usr/bin/clang++"
cxxstd: "03,11"
- name: "TOOLSET=clang COMPILER=/usr/bin/clang++ CXXST Job 13"
buildtype: "boost"
packages: "clang-3.4"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "/usr/bin/clang++"
sources: ""
llvm_os: ""
llvm_ver: ""
toolset: "clang"
compiler: "/usr/bin/clang++"
cxxstd: "03,11"
- name: "TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03, Job 14"
buildtype: "boost"
packages: "clang-3.5 libstdc++-4.9-dev"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "clang++-3.5"
sources: ""
llvm_os: "precise"
llvm_ver: "3.5"
toolset: "clang"
compiler: "clang++-3.5"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03, Job 15"
buildtype: "boost"
packages: "clang-3.6"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "clang++-3.6"
sources: ""
llvm_os: "precise"
llvm_ver: "3.6"
toolset: "clang"
compiler: "clang++-3.6"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03, Job 16"
buildtype: "boost"
packages: "clang-3.7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "clang++-3.7"
sources: ""
llvm_os: "precise"
llvm_ver: "3.7"
toolset: "clang"
compiler: "clang++-3.7"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03, Job 17"
buildtype: "boost"
packages: "clang-3.8 libstdc++-4.9-dev"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "clang++-3.8"
sources: ""
llvm_os: "precise"
llvm_ver: "3.8"
toolset: "clang"
compiler: "clang++-3.8"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03, Job 18"
buildtype: "boost"
packages: "clang-3.9 libstdc++-4.9-dev"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "clang++-3.9"
sources: ""
llvm_os: "precise"
llvm_ver: "3.9"
toolset: "clang"
compiler: "clang++-3.9"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03, Job 19"
buildtype: "boost"
packages: "clang-4.0"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "clang++-4.0"
sources: ""
llvm_os: "trusty"
llvm_ver: "4.0"
toolset: "clang"
compiler: "clang++-4.0"
cxxstd: "03,11,14"
- name: "TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03, Job 20"
buildtype: "boost"
packages: "clang-5.0"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "clang++-5.0"
sources: ""
llvm_os: "trusty"
llvm_ver: "5.0"
toolset: "clang"
compiler: "clang++-5.0"
cxxstd: "03,11,14,1z"
- name: "TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03, Job 21"
buildtype: "boost"
packages: "clang-6.0"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:14.04"
cxx: "clang++-6.0"
sources: ""
llvm_os: "trusty"
llvm_ver: "6.0"
toolset: "clang"
compiler: "clang++-6.0"
cxxstd: "03,11,14,17,2a"
- name: "TOOLSET=clang COMPILER=clang++-7 CXXSTD=03,11 Job 22"
buildtype: "boost"
packages: "clang-7"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "clang++-7"
sources: ""
llvm_os: "xenial"
llvm_ver: "7"
toolset: "clang"
compiler: "clang++-7"
cxxstd: "03,11,14,17,2a"
- name: "UBSAN=1 TOOLSET=clang COMPILER=clang++-7 CXXS Job 23"
buildtype: "boost"
packages: "clang-7 libstdc++-5-dev"
packages_to_remove: ""
os: "ubuntu-20.04"
container: "ubuntu:16.04"
cxx: "clang++-7"
sources: ""
llvm_os: "xenial"
llvm_ver: "7"
ubsan: "1"
toolset: "clang"
compiler: "clang++-7"
cxxstd: "03,11,14,17,2a"
ubsan_options: "print_stacktrace=1"
- name: "TOOLSET=clang COMPILER=clang++-libc++ CXXSTD= Job 24"
buildtype: "boost"
packages: " libc++-9-dev libc++abi-9-dev"
packages_to_remove: "libc++-dev libc++abi-dev"
os: "ubuntu-18.04"
cxx: "clang++-libc++"
sources: ""
llvm_os: "xenial"
llvm_ver: "9"
toolset: "clang"
compiler: "clang++-libc++"
cxxstd: "03,11,14,1z"
- name: "UBSAN=1 TOOLSET=clang COMPILER=clang++-libc++ Job 25"
buildtype: "boost"
packages: " libc++-9-dev libc++abi-9-dev"
packages_to_remove: "libc++-dev libc++abi-dev"
os: "ubuntu-18.04"
cxx: "clang++-libc++"
sources: ""
llvm_os: "xenial"
llvm_ver: "9"
ubsan: "1"
toolset: "clang"
compiler: "clang++-libc++"
cxxstd: "03,11,14,1z"
ubsan_options: "print_stacktrace=1"
runs-on: ${{matrix.os}}
container:
image: ${{matrix.container}}
volumes:
- /node20217:/node20217:rw,rshared
- ${{ startsWith(matrix.container, 'ubuntu:1') && '/node20217:/__e/node20:ro,rshared' || ' ' }}
defaults:
run:
shell: bash
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- name: Setup container environment
if: matrix.container
- name: Check if running in container
if: matrix.container != ''
run: echo "GHA_CONTAINER=${{ matrix.container }}" >> $GITHUB_ENV
- name: If running in container, upgrade packages
if: matrix.container != ''
run: |
apt-get update
apt-get -y install sudo python3 git g++ curl xz-utils
if [[ "${{matrix.container}}" == "ubuntu:1"* ]]; then
# Node 20 doesn't work with Ubuntu 16/18 glibc: https://github.com/actions/checkout/issues/1590
curl -sL https://archives.boost.io/misc/node/node-v20.9.0-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217
apt-get -o Acquire::Retries=3 update && DEBIAN_FRONTEND=noninteractive apt-get -y install tzdata && apt-get -o Acquire::Retries=3 install -y sudo software-properties-common wget curl apt-transport-https make apt-file sudo unzip libssl-dev build-essential autotools-dev autoconf automake g++ libc++-helpers python ruby cpio gcc-multilib g++-multilib pkgconf python3 ccache libpython-dev
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get -o Acquire::Retries=3 update && apt-get -o Acquire::Retries=3 -y install git
python_version=$(python3 -c 'import sys; print("{0.major}.{0.minor}".format(sys.version_info))')
sudo wget https://bootstrap.pypa.io/pip/$python_version/get-pip.py
sudo python3 get-pip.py
sudo /usr/local/bin/pip install cmake
- uses: actions/checkout@v2
- name: linux
shell: bash
env:
CXX: ${{ matrix.cxx }}
SOURCES: ${{ matrix.sources }}
LLVM_OS: ${{ matrix.llvm_os }}
LLVM_VER: ${{ matrix.llvm_ver }}
PACKAGES: ${{ matrix.packages }}
PACKAGES_TO_REMOVE: ${{ matrix.packages_to_remove }}
JOB_BUILDTYPE: ${{ matrix.buildtype }}
TOOLSET: ${{ matrix.toolset }}
COMPILER: ${{ matrix.compiler }}
CXXSTD: ${{ matrix.cxxstd }}
UBSAN: ${{ matrix.ubsan }}
UBSAN_OPTIONS: ${{ matrix.ubsan_options }}
LINKFLAGS: ${{ matrix.linkflags }}
TRAVIS_BRANCH: ${{ github.base_ref }}
TRAVIS_OS_NAME: "linux"
run: |
echo '==================================> SETUP'
echo '==================================> PACKAGES'
set -e
if [ -n "$PACKAGES_TO_REMOVE" ]; then sudo apt-get purge -y $PACKAGES_TO_REMOVE; fi
echo ">>>>> APT: REPO.."
for i in {1..3}; do sudo -E apt-add-repository -y "ppa:ubuntu-toolchain-r/test" && break || sleep 2; done
if test -n "${LLVM_OS}" ; then
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
if test -n "${LLVM_VER}" ; then
sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main"
else
# Snapshot (i.e. trunk) build of clang
sudo -E apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS} main"
fi
fi
echo ">>>>> APT: UPDATE.."
sudo -E apt-get -o Acquire::Retries=3 update
if test -n "${SOURCES}" ; then
echo ">>>>> APT: INSTALL SOURCES.."
for SOURCE in $SOURCES; do
sudo -E apt-add-repository ppa:$SOURCE
done
fi
echo ">>>>> APT: INSTALL ${PACKAGES}.."
sudo -E DEBIAN_FRONTEND=noninteractive apt-get -o Acquire::Retries=3 -y --no-install-suggests --no-install-recommends install ${PACKAGES}
- uses: actions/checkout@v4
echo '==================================> INSTALL AND COMPILE'
set -e
export TRAVIS_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}
export VCS_COMMIT_ID=$GITHUB_SHA
export GIT_COMMIT=$GITHUB_SHA
export REPO_NAME=$(basename $GITHUB_REPOSITORY)
export USER=$(whoami)
export CC=${CC:-gcc}
export PATH=~/.local/bin:/usr/local/bin:$PATH
- name: Install packages
if: matrix.install
run: |
sudo apt-get update
sudo apt-get -y install ${{matrix.install}}
if [ "$JOB_BUILDTYPE" == "boost" ]; then
echo '==================================> INSTALL'
- name: Setup Boost
run: |
echo GITHUB_REPOSITORY: $GITHUB_REPOSITORY
LIBRARY=${GITHUB_REPOSITORY#*/}
echo LIBRARY: $LIBRARY
echo "LIBRARY=$LIBRARY" >> $GITHUB_ENV
echo GITHUB_BASE_REF: $GITHUB_BASE_REF
echo GITHUB_REF: $GITHUB_REF
REF=${GITHUB_BASE_REF:-$GITHUB_REF}
REF=${REF#refs/heads/}
echo REF: $REF
BOOST_BRANCH=develop && [ "$REF" == "master" ] && BOOST_BRANCH=master || true
echo BOOST_BRANCH: $BOOST_BRANCH
cd ..
BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
git submodule update --init tools/boostdep
python3 tools/boostdep/depinst/depinst.py -I example --git_args "--jobs 3" $LIBRARY
git submodule update --init
git rm --ignore-unmatch libs/multi_index/
./bootstrap.sh
./b2 -d0 headers
./b2 headers
mkdir libs/multi_index
cp -r $TRAVIS_BUILD_DIR/* libs/multi_index
- name: Create user-config.jam
if: matrix.compiler
run: |
echo "using ${{matrix.toolset}} : : ${{matrix.compiler}} ;" > ~/user-config.jam
echo '==================================> SCRIPT'
- name: Run tests
run: |
cd ../boost-root
export ADDRMD=${{matrix.address-model}}
./b2 -j3 libs/$LIBRARY/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} ${ADDRMD:+address-model=$ADDRMD} variant=debug,release
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
./b2 libs/multi_index/test toolset=$TOOLSET cxxstd=$CXXSTD
windows:
fi
osx:
strategy:
fail-fast: false
matrix:
include:
- toolset: msvc-14.3
cxxstd: "14,17,20,latest"
addrmd: 32,64
os: windows-2022
- toolset: clang-win
cxxstd: "14,17,latest"
addrmd: 32,64
os: windows-2022
- toolset: gcc
cxxstd: "11,14,17,2a"
addrmd: 64
os: windows-2022
- name: "TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,1 Job 26"
buildtype: "boost"
packages: ""
os: "macos-10.15"
cxx: "clang++"
sources: ""
llvm_os: ""
llvm_ver: ""
xcode_version: 11.7
toolset: "clang"
compiler: "clang++"
cxxstd: "03,11,14,1z"
runs-on: ${{matrix.os}}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v2
- name: Setup Boost
shell: cmd
- name: Set DEVELOPER_DIR
if: matrix.xcode_version != ''
run: echo "DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode_version }}.app/Contents/Developer" >> $GITHUB_ENV
- name: Test DEVELOPER_DIR
run: echo $DEVELOPER_DIR
- name: "osx"
shell: bash
env:
CXX: ${{ matrix.cxx }}
SOURCES: ${{ matrix.sources }}
LLVM_OS: ${{ matrix.llvm_os }}
LLVM_VER: ${{ matrix.llvm_ver }}
PACKAGES: ${{ matrix.packages }}
JOB_BUILDTYPE: ${{ matrix.buildtype }}
TOOLSET: ${{ matrix.toolset }}
COMPILER: ${{ matrix.compiler }}
CXXSTD: ${{ matrix.cxxstd }}
UBSAN: ${{ matrix.ubsan }}
UBSAN_OPTIONS: ${{ matrix.ubsan_options }}
LINKFLAGS: ${{ matrix.linkflags }}
TRAVIS_BRANCH: ${{ github.base_ref }}
TRAVIS_OS_NAME: "osx"
run: |
echo GITHUB_REPOSITORY: %GITHUB_REPOSITORY%
for /f %%i in ("%GITHUB_REPOSITORY%") do set LIBRARY=%%~nxi
echo LIBRARY: %LIBRARY%
echo LIBRARY=%LIBRARY%>>%GITHUB_ENV%
echo GITHUB_BASE_REF: %GITHUB_BASE_REF%
echo GITHUB_REF: %GITHUB_REF%
if "%GITHUB_BASE_REF%" == "" set GITHUB_BASE_REF=%GITHUB_REF%
set BOOST_BRANCH=develop
for /f %%i in ("%GITHUB_BASE_REF%") do if "%%~nxi" == "master" set BOOST_BRANCH=master
echo BOOST_BRANCH: %BOOST_BRANCH%
echo '==================================> SETUP'
set -e
sudo mv /Library/Developer/CommandLineTools /Library/Developer/CommandLineTools.bck
echo '==================================> PACKAGES'
echo '==================================> INSTALL AND COMPILE'
set -e
export TRAVIS_BUILD_DIR=$(pwd)
export TRAVIS_BRANCH=${TRAVIS_BRANCH:-$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')}
export VCS_COMMIT_ID=$GITHUB_SHA
export GIT_COMMIT=$GITHUB_SHA
export REPO_NAME=$(basename $GITHUB_REPOSITORY)
export USER=$(whoami)
export CC=${CC:-gcc}
export PATH=~/.local/bin:/usr/local/bin:$PATH
if [ "$JOB_BUILDTYPE" == "boost" ]; then
echo '==================================> INSTALL'
cd ..
git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root
xcopy /s /e /q %GITHUB_WORKSPACE% libs\%LIBRARY%\
git submodule update --init tools/boostdep
python tools/boostdep/depinst/depinst.py -I example --git_args "--jobs 3" %LIBRARY%
cmd /c bootstrap
b2 -d0 headers
git submodule update --init
git rm --ignore-unmatch libs/multi_index/
./bootstrap.sh
./b2 headers
mkdir libs/multi_index
cp -r $TRAVIS_BUILD_DIR/* libs/multi_index
- name: Run tests
shell: cmd
run: |
cd ../boost-root
b2 -j3 libs/%LIBRARY%/test toolset=${{matrix.toolset}} cxxstd=${{matrix.cxxstd}} address-model=${{matrix.addrmd}} variant=debug,release embed-manifest-via=linker
echo '==================================> SCRIPT'
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
./b2 libs/multi_index/test toolset=$TOOLSET cxxstd=$CXXSTD
fi
+7 -3
View File
@@ -3,13 +3,12 @@
# Distributed under the Boost Software License, Version 1.0.
# https://www.boost.org/LICENSE_1_0.txt
cmake_minimum_required(VERSION 3.8...3.16)
cmake_minimum_required(VERSION 3.5...3.16)
project(boost_multi_index VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
add_library(boost_multi_index INTERFACE)
add_library(Boost::multi_index ALIAS boost_multi_index)
target_compile_features(boost_multi_index INTERFACE cxx_std_11)
target_include_directories(boost_multi_index INTERFACE include)
@@ -20,10 +19,15 @@ target_link_libraries(boost_multi_index
Boost::config
Boost::container_hash
Boost::core
Boost::foreach
Boost::integer
Boost::mp11
Boost::iterator
Boost::move
Boost::mpl
Boost::preprocessor
Boost::serialization
Boost::smart_ptr
Boost::static_assert
Boost::throw_exception
Boost::tuple
Boost::type_traits
+4 -42
View File
@@ -1,48 +1,10 @@
# Boost Multi-index Containers Library
[![Branch](https://img.shields.io/badge/branch-master-brightgreen.svg)](https://github.com/boostorg/multi_index/tree/master) [![CI](https://github.com/boostorg/multi_index/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/boostorg/multi_index/actions/workflows/ci.yml) [![Drone status](https://img.shields.io/drone/build/boostorg/multi_index/master?server=https%3A%2F%2Fdrone.cpp.al&logo=drone&logoColor=%23CCCCCC&label=CI)](https://drone.cpp.al/boostorg/multi_index) [![Deps](https://img.shields.io/badge/deps-master-brightgreen.svg)](https://pdimov.github.io/boostdep-report/master/multi_index.html) [![Documentation](https://img.shields.io/badge/docs-master-brightgreen.svg)](https://www.boost.org/doc/libs/master/libs/multi_index) [![Enter the Matrix](https://img.shields.io/badge/matrix-master-brightgreen.svg)](https://regression.boost.org/master/developer/multi_index.html)<br/>
[![Branch](https://img.shields.io/badge/branch-develop-brightgreen.svg)](https://github.com/boostorg/multi_index/tree/develop) [![CI](https://github.com/boostorg/multi_index/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/boostorg/multi_index/actions/workflows/ci.yml) [![Drone status](https://img.shields.io/drone/build/boostorg/multi_index/develop?server=https%3A%2F%2Fdrone.cpp.al&logo=drone&logoColor=%23CCCCCC&label=CI)](https://drone.cpp.al/boostorg/multi_index) [![Deps](https://img.shields.io/badge/deps-develop-brightgreen.svg)](https://pdimov.github.io/boostdep-report/develop/multi_index.html) [![Documentation](https://img.shields.io/badge/docs-develop-brightgreen.svg)](https://www.boost.org/doc/libs/develop/libs/multi_index) [![Enter the Matrix](https://img.shields.io/badge/matrix-develop-brightgreen.svg)](https://regression.boost.org/develop/developer/multi_index.html)<br/>
[![BSL 1.0](https://img.shields.io/badge/license-BSL_1.0-blue.svg)](https://www.boost.org/users/license.html) <img alt="C++11 required" src="https://img.shields.io/badge/standard-C%2b%2b11-blue.svg"> <img alt="Header-only library" src="https://img.shields.io/badge/build-header--only-blue.svg">
Branch | Travis | Drone | GitHub Actions | AppVeyor | Regression tests
---------|--------|-------|----------------|----------|-----------------
develop | [![Build Status](https://travis-ci.com/boostorg/multi_index.svg?branch=develop)](https://travis-ci.com/boostorg/multi_index) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/multi_index/status.svg?ref=refs/heads/develop)](https://drone.cpp.al/boostorg/multi_index) | [![Build Status](https://github.com/boostorg/multi_index/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/boostorg/multi_index/actions/workflows/ci.yml?query=branch:develop) | [![Build Status](https://ci.appveyor.com/api/projects/status/github/boostorg/multi_index?branch=develop&svg=true)](https://ci.appveyor.com/project/joaquintides/multi-index) | [![Test Results](./test_results.svg)](https://www.boost.org/development/tests/develop/developer/multi_index.html)
master | [![Build Status](https://travis-ci.com/boostorg/multi_index.svg?branch=master)](https://travis-ci.com/boostorg/multi_index) | [![Build Status](https://drone.cpp.al/api/badges/boostorg/multi_index/status.svg?ref=refs/heads/master)](https://drone.cpp.al/boostorg/multi_index) | [![Build Status](https://github.com/boostorg/multi_index/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/boostorg/multi_index/actions/workflows/ci.yml?query=branch:master) | [![Build Status](https://ci.appveyor.com/api/projects/status/github/boostorg/multi_index?branch=master&svg=true)](https://ci.appveyor.com/project/joaquintides/multi-index) | [![Test Results](./test_results.svg)](https://www.boost.org/development/tests/master/developer/multi_index.html)
[Boost.MultiIndex](http://boost.org/libs/multi_index) provides a class template
named `multi_index_container` which enables the construction of containers
maintaining one or more indices with different sorting and access semantics.
## Learn about Boost.MultiIndex
* [Online documentation](https://boost.org/libs/multi_index)
## Install Boost.MultiIndex
* [Download Boost](https://www.boost.org/users/download/) and you're ready to go (this is a header-only library requiring no building).
* Using Conan 2: In case you don't have it yet, add an entry for Boost in your `conanfile.txt` (the example requires at least Boost 1.86):
```
[requires]
boost/[>=1.86.0]
```
<ul>If you're not using any compiled Boost library, the following will skip building altogether:</ul>
```
[options]
boost:header_only=True
```
* Using vcpkg: Execute the command
```
vcpkg install boost-multi-index
```
* Using CMake: [Boost CMake support infrastructure](https://github.com/boostorg/cmake)
allows you to use CMake directly to download, build and consume all of Boost or
some specific libraries.
## Support
* Join the **#boost** discussion group at [cpplang.slack.com](https://cpplang.slack.com/)
([ask for an invite](https://cppalliance.org/slack/) if youre not a member of this workspace yet)
* Ask in the [Boost Users mailing list](https://lists.boost.org/mailman/listinfo.cgi/boost-users)
(add the `[multi_index]` tag at the beginning of the subject line)
* [File an issue](https://github.com/boostorg/multi_index/issues)
## Contribute
* [Pull requests](https://github.com/boostorg/multi_index/pulls) against **develop** branch are most welcome.
Note that by submitting patches you agree to license your modifications under the [Boost Software License, Version 1.0](http://www.boost.org/LICENSE_1_0.txt).
+1 -1
View File
@@ -15,7 +15,7 @@ branches:
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
TOOLSET: msvc-14.0
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0,msvc-14.0
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: msvc-14.1
CXXSTD: 14,17
-35
View File
@@ -1,35 +0,0 @@
# Copyright René Ferdinand Rivera Morell 2023-2024
# 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)
require-b2 5.2 ;
constant boost_dependencies :
/boost/assert//boost_assert
/boost/bind//boost_bind
/boost/config//boost_config
/boost/container_hash//boost_container_hash
/boost/core//boost_core
/boost/integer//boost_integer
/boost/mp11//boost_mp11
/boost/preprocessor//boost_preprocessor
/boost/smart_ptr//boost_smart_ptr
/boost/throw_exception//boost_throw_exception
/boost/tuple//boost_tuple
/boost/type_traits//boost_type_traits
/boost/utility//boost_utility ;
project /boost/multi_index
: common-requirements
<include>include
;
explicit
[ alias boost_multi_index : : : : <library>$(boost_dependencies) ]
[ alias all : boost_multi_index example perf test ]
;
call-if : boost-library multi_index
;
+402
View File
@@ -0,0 +1,402 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0.1 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.MultiIndex Documentation - Compiler specifics</title>
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="start" href="index.html">
<link rel="prev" href="reference/key_extraction.html">
<link rel="up" href="index.html">
<link rel="next" href="performance.html">
</head>
<body>
<h1><img src="../../../boost.png" alt="boost.png (6897 bytes)" align=
"middle" width="277" height="86">Boost.MultiIndex Compiler specifics</h1>
<div class="prev_link"><a href="reference/key_extraction.html"><img src="prev.gif" alt="key extraction" border="0"><br>
Key extraction
</a></div>
<div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
Index
</a></div>
<div class="next_link"><a href="performance.html"><img src="next.gif" alt="performance" border="0"><br>
Performance
</a></div><br clear="all" style="clear: all;">
<hr>
<p>
Boost.MultiIndex utilizes some C++11 capabilities but is also equipped
to work reasonably well in decent C++03-compliant environments.
We list some of the possible limitations along with suitable workarounds when available.
</p>
<h2>Contents</h2>
<ul>
<li><a href="#move">Move semantics</a></li>
<li><a href="#allocator_awareness">Allocator awareness</a></li>
<li><a href="#emplace">Emplace functions</a></li>
<li><a href="#initializer_list">Initializer lists</a></li>
<li><a href="#tuple">Tuples</a></li>
<li><a href="#symbol_reduction">Reduction of symbol name lengths</a>
<ul>
<li><a href="#argument_limitation">Limitation of maximum number of arguments</a></li>
<li><a href="#type_hiding">Type hiding</a></li>
</ul>
</li>
<li><a href="#legacy">Legacy compilers</a></li>
</ul>
<h2><a name="move">Move semantics</a></h2>
<p>
Boost.MultiIndex uses <a href="../../../doc/html/move.html">Boost.Move</a>
to support compilers without rvalue references. In such scenarios, taking
advantage of <code>multi_index_container&lt;Value&gt;</code> capabilities for
increased efficiency in insertion and handling of moveable-only elements will
require that <code>Value</code> be suitably instrumented.
</p>
<h2><a name="allocator_awareness">Allocator awareness</a></h2>
<p>
In pre-C++11 compilers or defective environments without proper
<a href="https://en.cppreference.com/w/cpp/named_req/AllocatorAwareContainer">allocator
awareness</a> machinery (basically, <code>std::allocator_traits</code>),
Boost.MultiIndex behaves as if
<code>std::allocator_traits&lt;allocator_type>::propagate_on_container_*::value</code>
were <code>false</code> for all allocators.
</p>
<h2><a name="emplace">Emplace functions</a></h2>
<p>
In compilers without variadic template support, Boost.MultiIndex emplace
functions emulate this missing functionality by accepting up to
<code>BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS</code>
construction arguments that are internally forwarded with
<a href="../../../doc/html/move.html">Boost.Move</a>:
only constant lvalue references and rvalues are permitted as construction arguments
in such case.
</p>
<p>
<code>BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS</code>, which by default is 5, can
be globally defined by the user to a different value.
</p>
<h2><a name="initializer_list">Initializer lists</a></h2>
<p>
No transparent emulation of this functionality can be provided in the absence of
<code>std::initializer_list</code>: consider
<a href="../../../libs/assign/index.html">Boost.Assign</a> as a
possible replacement.
</p>
<h2><a name="tuple">Tuples</a></h2>
<p>
Everywhere where <code>std::tuple</code>s are used in the library interface,
<code>boost::tuple</code>s can be resorted to in their place. The converse, however,
is not true.
</p>
<h2><a name="symbol_reduction">Reduction of symbol name lengths</a></h2>
<p>
The types generated on the instantiations of <code>multi_index_container</code>s
typically produce very long symbol names, sometimes beyond the internal limits
of some compilers. There are several techniques to shorten generated symbol
names: these techniques have also the beneficial side effect that resulting error
messages are more readable.
</p>
<h3><a name="argument_limitation">Limitation of maximum number of arguments</a></h3>
<p>
The class templates <a href="reference/indices.html#indexed_by"><code>indexed_by</code></a>,
<a href="reference/indices.html#tag"><code>tag</code></a> and
<a href="reference/key_extraction.html#composite_key"><code>composite_key</code></a>
accept a variable number of arguments whose maximum number is limited by
internal macros. Even non-used arguments contribute to the final types,
so manually adjusting the corresponding macros can result in a modest reduction
of symbol names.
</p>
<p align="center">
<table cellspacing="0">
<caption><b>Limiting maximum number of arguments of some class templates
of Boost.MultiIndex.</b></caption>
<tr>
<th>class template</th>
<th>limiting macro</th>
<th>default value</th>
</tr>
<tr>
<td align="center">&nbsp;<code>indexed_by</code>&nbsp;</td>
<td align="center">&nbsp;<code>BOOST_MULTI_INDEX_LIMIT_INDEXED_BY_SIZE</code>&nbsp;</td>
<td align="center">20</td>
</tr>
<tr class="odd_tr">
<td align="center">&nbsp;<code>tag</code>&nbsp;</td>
<td align="center">&nbsp;<code>BOOST_MULTI_INDEX_LIMIT_TAG_SIZE</code>&nbsp;</td>
<td align="center">20</td>
</tr>
<tr>
<td align="center">&nbsp;<code>composite_key</code>&nbsp;</td>
<td align="center">&nbsp;<code>BOOST_MULTI_INDEX_LIMIT_COMPOSITE_KEY_SIZE</code>&nbsp;</td>
<td align="center">10</td>
</tr>
</table>
</p>
<h3><a name="type_hiding">Type hiding</a></h3>
<p>
Consider a typical instantiation of <code>multi_index_container</code>:
</p>
<blockquote><pre>
<span class=keyword>typedef</span> <span class=identifier>multi_index_container</span><span class=special>&lt;</span>
<span class=identifier>employee</span><span class=special>,</span>
<span class=identifier>indexed_by</span><span class=special>&lt;</span>
<span class=identifier>ordered_unique</span><span class=special>&lt;</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>&gt;</span> <span class=special>&gt;,</span>
<span class=identifier>ordered_non_unique</span><span class=special>&lt;</span><span class=identifier>member</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>,</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>,&amp;</span><span class=identifier>employee</span><span class=special>::</span><span class=identifier>name</span><span class=special>&gt;</span> <span class=special>&gt;,</span>
<span class=identifier>ordered_unique</span><span class=special>&lt;</span><span class=identifier>member</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>,</span><span class=keyword>int</span><span class=special>,&amp;</span><span class=identifier>employee</span><span class=special>::</span><span class=identifier>ssnumber</span><span class=special>&gt;</span> <span class=special>&gt;</span>
<span class=special>&gt;</span>
<span class=special>&gt;</span> <span class=identifier>employee_set</span><span class=special>;</span>
</pre></blockquote>
<p>
Then, for instance, the type <code>employee_set::nth_index&lt;0&gt;::type</code>
resolves to the following in GCC:
</p>
<blockquote><pre>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>detail</span><span class=special>::</span><span class=identifier>ordered_index</span><span class=special>&lt;</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>&gt;,</span>
<span class=identifier>std</span><span class=special>::</span><span class=identifier>less</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>&gt;,</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>detail</span><span class=special>::</span><span class=identifier>nth_layer</span><span class=special>&lt;</span>
<span class=number>1</span><span class=special>,</span> <span class=identifier>employee</span><span class=special>,</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>indexed_by</span><span class=special>&lt;</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>ordered_unique</span><span class=special>&lt;</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>&gt;,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span>
<span class=special>&gt;,</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>ordered_non_unique</span><span class=special>&lt;</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>member</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>,</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>,</span> <span class=special>&amp;</span><span class=identifier>employee</span><span class=special>::</span><span class=identifier>name</span><span class=special>&gt;,</span>
<span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span>
<span class=special>&gt;,</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>ordered_unique</span><span class=special>&lt;</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>member</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>,</span> <span class=keyword>int</span><span class=special>,</span> <span class=special>&amp;</span><span class=identifier>employee</span><span class=special>::</span><span class=identifier>ssnumber</span><span class=special>&gt;,</span>
<span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span>
<span class=special>&gt;,</span>
<span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span>
<span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span>
<span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>,</span> <span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span>
<span class=special>&gt;,</span>
<span class=identifier>std</span><span class=special>::</span><span class=identifier>allocator</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>&gt;</span>
<span class=special>&gt;,</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>mpl</span><span class=special>::</span><span class=identifier>vector0</span><span class=special>&lt;</span><span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>&gt;,</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>detail</span><span class=special>::</span><span class=identifier>ordered_unique_tag</span>
<span class=special>&gt;</span>
</pre></blockquote>
<p>
It can be seen that a significant portion of the type name is contributed by
the <code>indexed_by&lt;...&gt;</code> part, which is nothing but an expanded
version of the index specifier list provided in the definition of
<code>employee_set</code>. We can prevent this very long name from appearing
in the final type by encapsulating it into another, shorter-named construct:
</p>
<blockquote><pre>
<span class=comment>// reducing symbol names through type hiding
// type hide the index specifier list within employee_set_indices</span>
<span class=keyword>struct</span> <span class=identifier>employee_set_indices</span><span class=special>:</span>
<span class=identifier>indexed_by</span><span class=special>&lt;</span>
<span class=identifier>ordered_unique</span><span class=special>&lt;</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>&gt;</span> <span class=special>&gt;,</span>
<span class=identifier>ordered_non_unique</span><span class=special>&lt;</span><span class=identifier>member</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>,</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>,&amp;</span><span class=identifier>employee</span><span class=special>::</span><span class=identifier>name</span><span class=special>&gt;</span> <span class=special>&gt;,</span>
<span class=identifier>ordered_unique</span><span class=special>&lt;</span><span class=identifier>member</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>,</span><span class=keyword>int</span><span class=special>,&amp;</span><span class=identifier>employee</span><span class=special>::</span><span class=identifier>ssnumber</span><span class=special>&gt;</span> <span class=special>&gt;</span>
<span class=special>&gt;</span>
<span class=special>{};</span>
<span class=keyword>typedef</span> <span class=identifier>multi_index_container</span><span class=special>&lt;</span>
<span class=identifier>employee</span><span class=special>,</span>
<span class=identifier>employee_set_indices</span>
<span class=special>&gt;</span> <span class=identifier>employee_set</span><span class=special>;</span>
</pre></blockquote>
<p>
<code>employee_set_indices</code> works as a conventional <code>typedef</code>
in all respects, save for a detail: its name does not explicitly
include the information contained in the <code>indexed_by</code> instantiation.
Applying this technique, <code>employee_set::nth_index&lt;0&gt;::type</code>
now becomes:
</p>
<blockquote><pre>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>detail</span><span class=special>::</span><span class=identifier>ordered_index</span><span class=special>&lt;</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>&gt;,</span>
<span class=identifier>std</span><span class=special>::</span><span class=identifier>less</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>&gt;,</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>detail</span><span class=special>::</span><span class=identifier>nth_layer</span><span class=special>&lt;</span>
<span class=number>1</span><span class=special>,</span> <span class=identifier>employee</span><span class=special>,</span>
<span class=identifier>employee_set_indices</span><span class=special>,</span>
<span class=identifier>std</span><span class=special>::</span><span class=identifier>allocator</span><span class=special>&lt;</span><span class=identifier>employee</span><span class=special>&gt;</span>
<span class=special>&gt;,</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>mpl</span><span class=special>::</span><span class=identifier>vector0</span><span class=special>&lt;</span><span class=identifier>mpl_</span><span class=special>::</span><span class=identifier>na</span><span class=special>&gt;,</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>detail</span><span class=special>::</span><span class=identifier>ordered_unique_tag</span>
<span class=special>&gt;</span>
</pre></blockquote>
<p>
which is considerably shorter than the original, and also more
easily parsed by a human reader. Type hiding would not work if, instead of
making <code>employee_set_indices</code> a derived <code>struct</code> of
<code>indexed_by&lt;...&gt;</code>, we had defined it as a <code>typedef</code>:
<code>typedef</code>s are syntactic aliases and usually get expanded
by the compiler before doing any further type handling.
</p>
<p>
Type hiding techniques can also be applied to <code>composite_key</code> intantiations,
which often contribute a great deal to symbol name lengths.
</p>
<h2><a name="legacy">Legacy compilers</a></h2>
<p>
Boost.MultiIndex support for legacy compilers is not actively kept, so if you happen
to work with an old environment you might need to use a former version of the library.
A table is provided of some legacy compilers along with the latest version of
Boost.MultiIndex known to work for them (frequently with limitations as explained
in the corresponding compiler specifics section.) If you successfully try one of those
with newer versions of Boost.MultiIndex than stated here, please report back so that
the information can be updated.
</p>
<p align="center">
<table cellspacing="0" cellpadding="5">
<caption><b>Support for legacy compilers.</b></caption>
<tr>
<th>Compiler</th>
<th>Latest known<br>compatible version</th>
<th>Date</th>
</tr>
<tr>
<td>Borland C++ Builder 6.4 through 2006, CodeGear C++Builder 2010</td>
<td>Never worked with Boost.MultiIndex</td>
<td></td>
</tr>
<tr class="odd_tr">
<td>Comeau C/C++ 4.3.10.1 for Windows (VC++ 9.0 backend)</td>
<td><a href="http://www.boost.org/doc/libs/1_38_0/libs/multi_index/doc/compiler_specifics.html#comeau_43101_win_vc7_71">Boost 1.38</a></td>
<td>February 2009</td>
</tr>
<tr>
<td>Compaq C++ 6.5-042 through 7.1-006 for Tru64 UNIX</td>
<td><a href="http://www.boost.org/doc/libs/1_38_0/libs/multi_index/doc/compiler_specifics.html#compaq_65">Boost 1.38</a></td>
<td>February 2009</td>
</tr>
<tr class="odd_tr">
<td>GCC 3.2 through 3.4</td>
<td><a href="http://www.boost.org/doc/libs/1_41_0/libs/multi_index/doc/compiler_specifics.html#gcc_32">Boost 1.41</a></td>
<td>November 2009</td>
</tr>
<tr>
<td>HP aC++ A.06.12 through A.06.17 for HP-UX IA64</td>
<td><a href="http://www.boost.org/doc/libs/1_38_0/libs/multi_index/doc/compiler_specifics.html#acc_612_ia64">Boost 1.38</a></td>
<td>February 2009</td>
</tr>
<tr class="odd_tr">
<td>HP aC++ A.03.80 through A.03.85 for HP-UX PA-RISC</td>
<td><a href="http://www.boost.org/doc/libs/1_38_0/libs/multi_index/doc/compiler_specifics.html#acc_380_pa_risc">Boost 1.38</a></td>
<td>February 2009</td>
</tr>
<tr>
<td>IBM VisualAge C++ V6.0 for AIX</td>
<td><a href="http://www.boost.org/doc/libs/1_33_1/libs/multi_index/doc/compiler_specifics.html#va_60">Boost 1.33.1</a></td>
<td>December 2006</td>
</tr>
<tr class="odd_tr">
<td>IBM XL C/C++ V9.0 through V10.1 for AIX</td>
<td><a href="http://www.boost.org/doc/libs/1_41_0/libs/multi_index/doc/compiler_specifics.html#xl_90">Boost 1.41</a></td>
<td>November 2009</td>
</tr>
<tr>
<td>Intel C++ Compiler for Linux 8.1 through 11.1</td>
<td><a href="http://www.boost.org/doc/libs/1_41_0/libs/multi_index/doc/compiler_specifics.html#intel_81_lin">Boost 1.41</a></td>
<td>November 2009</td>
</tr>
<tr class="odd_tr">
<td>Intel C++ Compiler for Mac OS 9.1 through 11.0</td>
<td><a href="http://www.boost.org/doc/libs/1_41_0/libs/multi_index/doc/compiler_specifics.html#intel_91_mac">Boost 1.41</a></td>
<td>November 2009</td>
</tr>
<tr>
<td>Intel C++ Compiler for Windows 32-bit 8.0 through 11.1</td>
<td><a href="http://www.boost.org/doc/libs/1_41_0/libs/multi_index/doc/compiler_specifics.html#intel_80_win">Boost 1.41</a></td>
<td>November 2009</td>
</tr>
<tr class="odd_tr">
<td>Intel C++ Compiler for Windows 64-bit 10.0 through 11.11</td>
<td><a href="http://www.boost.org/doc/libs/1_41_0/libs/multi_index/doc/compiler_specifics.html#intel_100_win64">Boost 1.41</a></td>
<td>November 2009</td>
</tr>
<tr>
<td>Metrowerks CodeWarrior 8.3</td>
<td><a href="http://www.boost.org/doc/libs/1_36_0/libs/multi_index/doc/compiler_specifics.html#cw_83">Boost 1.36</a></td>
<td>August 2008</td>
</tr>
<tr class="odd_tr">
<td>Metrowerks CodeWarrior 9 through 9.5</td>
<td><a href="http://www.boost.org/doc/libs/1_34_1/libs/multi_index/doc/compiler_specifics.html#cw_9x">Boost 1.34.1</a></td>
<td>July 2007</td>
</tr>
<tr>
<td>Microsoft Visual C++ 6.0 Service Pack 5</td>
<td><a href="http://www.boost.org/doc/libs/1_36_0/libs/multi_index/doc/compiler_specifics.html#msvc_60">Boost 1.36</a></td>
<td>August 2008</td>
</tr>
<tr class="odd_tr">
<td>Microsoft Visual C++ 7.0</td>
<td><a href="http://www.boost.org/doc/libs/1_35_0/libs/multi_index/doc/compiler_specifics.html#msvc_70">Boost 1.35</a></td>
<td>March 2008</td>
</tr>
<tr>
<td>Sun Studio 10 through 12 Update 1 for Solaris</td>
<td><a href="http://www.boost.org/doc/libs/1_41_0/libs/multi_index/doc/compiler_specifics.html#sun_10">Boost 1.41</a></td>
<td>November 2009</td>
</tr>
</table>
</p>
<hr>
<div class="prev_link"><a href="reference/key_extraction.html"><img src="prev.gif" alt="key extraction" border="0"><br>
Key extraction
</a></div>
<div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
Index
</a></div>
<div class="next_link"><a href="performance.html"><img src="next.gif" alt="performance" border="0"><br>
Performance
</a></div><br clear="all" style="clear: all;">
<br>
<p>Revised January 25th 2020</p>
<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">
http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</body>
</html>
+1 -1
View File
@@ -105,7 +105,7 @@ See <a href="../example/bimap.cpp">source code</a>.
This example shows how to construct a bidirectional map with
<code>multi_index_container</code>. By a <i>bidirectional map</i> we mean
a container of <code>(const FromType,const ToType)</code> pairs
such that no two elements exist with the same first
such that no two elements exists with the same first
<i>or</i> second component (<code>std::map</code> only
guarantees uniqueness of the first component). Fast lookup is provided
for both keys. The program features a tiny Spanish-English
+3 -2
View File
@@ -67,6 +67,7 @@ examples of use developed in the documentation:
<ul>
<li><a href="tutorial/index.html">Tutorial</a></li>
<li><a href="reference/index.html">Reference</a></li>
<li><a href="compiler_specifics.html">Compiler specifics</a></li>
<li><a href="performance.html">Performance</a></li>
<li><a href="examples.html">Examples</a></li>
<li><a href="tests.html">Tests</a></li>
@@ -85,9 +86,9 @@ Tutorial
<br>
<p>Revised November 7th 2025</p>
<p>Revised April 19th 2015</p>
<p>&copy; Copyright 2003-2025 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
<p>&copy; Copyright 2003-2015 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">
+11 -11
View File
@@ -6,7 +6,7 @@
<title>Boost.MultiIndex Documentation - Performance</title>
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="start" href="index.html">
<link rel="prev" href="reference/key_extraction.html">
<link rel="prev" href="compiler_specifics.html">
<link rel="up" href="index.html">
<link rel="next" href="examples.html">
</head>
@@ -15,8 +15,8 @@
<h1><img src="../../../boost.png" alt="boost.png (6897 bytes)" align=
"middle" width="277" height="86">Boost.MultiIndex Performance</h1>
<div class="prev_link"><a href="reference/key_extraction.html"><img src="prev.gif" alt="key extraction" border="0"><br>
Key extraction
<div class="prev_link"><a href="compiler_specifics.html"><img src="prev.gif" alt="compiler specifics" border="0"><br>
Compiler specifics
</a></div>
<div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
Index
@@ -220,7 +220,7 @@ manual simulations.
The gain in space consumption of <code>multi_index_container</code> with
respect to its manual simulations is amenable to a very simple
theoretical analysis. For simplicity, we will ignore alignment
issues (which in general play in favor of <code>multi_index_container</code>).
issues (which in general play in favor of <code>multi_index_container</code>.)
</p>
<p>
@@ -285,7 +285,7 @@ Taking this fact into account, the former formula can be adjusted to:
<p>
where <i>O</i> is the number of ordered indices of the container, and <i>w</i>
is the system word size (typically 4 bytes on 32-bit architectures).
is the system word size (typically 4 bytes on 32-bit architectures.)
</p>
<p>
@@ -473,7 +473,7 @@ sequenced index.</b>
<p>
The figures confirm that in this case <code>multi_index_container</code> nodes are the
same size as those of its <code>std::list</code> counterpart.
same size than those of its <code>std::list</code> counterpart.
</p>
<h4><a name="time_1s">Execution time</a></h4>
@@ -725,7 +725,7 @@ factor, which ranges from 45% to 55%.
We have shown that <code>multi_index_container</code> outperforms, both in space and
time efficiency, equivalent data structures obtained from the manual
combination of STL containers. This improvement gets larger when the number
of indices increases.
of indices increase.
</p>
<p>
@@ -737,8 +737,8 @@ some improvements both in space consumption and execution time.
<hr>
<div class="prev_link"><a href="reference/key_extraction.html"><img src="prev.gif" alt="key extraction" border="0"><br>
Key extraction
<div class="prev_link"><a href="compiler_specifics.html"><img src="prev.gif" alt="compiler specifics" border="0"><br>
Compiler specifics
</a></div>
<div class="up_link"><a href="index.html"><img src="up.gif" alt="index" border="0"><br>
Index
@@ -749,9 +749,9 @@ Examples
<br>
<p>Revised November 7th 2025</p>
<p>Revised April 18th 2020</p>
<p>&copy; Copyright 2003-2025 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">
+9 -12
View File
@@ -199,7 +199,7 @@ together, with minor differences explicitly stated when they exist.
<p>
Except where noted or if the corresponding interface does not exist, hashed indices
(both unique and non-unique) satisfy the C++ requirements for unordered associative
containers at <b>[unord.req]</b> (supporting unique and equivalent keys, respectively).
containers at <b>[unord.req]</b> (supporting unique and equivalent keys, respectively.)
Iterators (including to the end of the index) and pointers and references to an element
remain valid during the lifetime of the associated container (which can change
upon swapping), or until the referred-to element is erased or extracted;
@@ -458,7 +458,7 @@ following types:
which determines the mechanism for extracting a key from <code>Value</code>,
must be a model of <a href="key_extraction.html#key_extractors">
<code>Key Extractor</code></a> from <code>Value</code>. <code>Hash</code> is a
<code>CopyConstructible</code> unary function object
<code>CopyConstructible</code>unary function object
taking a single argument of type <code>KeyFromValue::result_type</code> and returning a
value of type <code>std::size_t</code> in the range
<code>[0, std::numeric_limits&lt;std::size_t&gt;::max())</code>.
@@ -802,7 +802,7 @@ the number of elements in [<code>first</code>,<code>last</code>).<br>
<code>position</code> is a valid dereferenceable iterator of the index.<br>
<b>Effects:</b> Assigns the value <code>x</code> to the element pointed
to by <code>position</code> into the <code>multi_index_container</code> to which
the index belongs if, for the value <code>x</code>,
the index belongs if, for the value <code>x</code>
<ul>
<li>the index is non-unique OR no other element exists
(except possibly <code>*position</code>) with equivalent key,</li>
@@ -1305,12 +1305,9 @@ Operation: loading of a <code>multi_index_container</code> <code>m'</code> from
input archive (XML archive) <code>ar</code>.
<blockquote>
<b>Requires:</b> Additionally to the general requirements, the binary predicate
<code><i>value_eq</i>(m'.get&lt;i&gt;())</code> must be serialization-compatible with
<code><i>value_eq</i>(m.get&lt;i&gt;())</code>, where
<code><i>value_eq</i>(c)(x,y)</code> is defined as
<code>c.key_eq()(c.key_extractor()(x),c.key_extractor()(y))</code>
and <code>i</code> is the position of the hashed index in the container.<br>
<b>Requires:</b> Additionally to the general requirements, <code>key_eq()</code>
must be serialization-compatible with <code>m.get&lt;i&gt;().key_eq()</code>,
where <code>i</code> is the position of the hashed index in the container.<br>
<b>Postconditions:</b> On successful loading, the range
[<code>begin()</code>, <code>end()</code>) contains restored copies of every
element in [<code>m.get&lt;i&gt;().begin()</code>, <code>m.get&lt;i&gt;().end()</code>),
@@ -1355,7 +1352,7 @@ then <code>*it'</code> is the restored copy of <code>*it</code>; if <code>it</co
was <code>m.get&lt;i&gt;().end(n)</code> for some <code>n</code>, then
<code>it'==m'.get&lt;i&gt;().end(n)</code> (where <code>m</code> is the original
<code>multi_index_container</code>, <code>m'</code> its restored copy
and <code>i</code> is the ordinal of the index).<br>
and <code>i</code> is the ordinal of the index.)<br>
<b>Note:</b> It is allowed that <code>it</code> be a <code>const_local_iterator</code>
and the restored <code>it'</code> a <code>local_iterator</code>, or vice versa.
</blockquote>
@@ -1374,9 +1371,9 @@ Sequenced indices
<br>
<p>Revised March 15th 2024</p>
<p>Revised August 30th 2021</p>
<p>&copy; Copyright 2003-2024 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
<p>&copy; Copyright 2003-2021 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">
+32 -15
View File
@@ -81,7 +81,7 @@ appropriate interface of some index of the <code>multi_index_container</code>;
these operations, however, do have an impact on all other indices as
well: for instance, insertion through a given index may fail because
there exists another index which bans the operation in order to preserve
its invariant (like uniqueness of elements). This circumstance, rather
its invariant (like uniqueness of elements.) This circumstance, rather
than being an obstacle, yields much of the power of Boost.MultiIndex:
equivalent constructions based on manual composition of standard
containers would have to add a fair amount of code in order to
@@ -103,7 +103,7 @@ six primitives:
</ul>
The last two primitives deserve some further explanation: in order to
guarantee the invariants associated to each index (e.g. some definite
ordering), elements of a <code>multi_index_container</code> are not mutable.
ordering,) elements of a <code>multi_index_container</code> are not mutable.
To overcome this restriction, indices expose member functions
for replacement and modification which allow for the mutation of elements
in a controlled fashion. Immutability of elements does not significantly
@@ -120,8 +120,8 @@ These global operations are not directly exposed to the user, but rather
they are wrapped as appropriate by each index (for instance, ordered indices
provide a set-like suite of insertion member functions, whereas sequenced
and random access indices have <code>push_back</code> and <code>push_front</code>
operations). Boost.MultiIndex poses no particular conditions on
the interface of indices, although each index provided satisfies the C++ requirements for
operations.) Boost.MultiIndex poses no particular conditions on
the interface of indices, although each index provided satisfy the C++ requirements for
standard containers to the maximum extent possible within the conceptual framework
of the library.
</p>
@@ -212,7 +212,7 @@ index specifiers
<span class=keyword>namespace</span> <span class=identifier>multi_index</span><span class=special>{</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>T</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Ts</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>T0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Tn</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>indexed_by</span><span class=special>;</span>
<span class=special>}</span> <span class=comment>// namespace boost::multi_index</span>
@@ -223,19 +223,24 @@ index specifiers
<h3><a name="indexed_by">Class template <code>indexed_by</code></a></h3>
<p>
<code>indexed_by</code> is meant to be used to specify a
<code>indexed_by</code> is a model of
<a href="../../../../libs/mpl/doc/refmanual/random-access-sequence.html">
<code>MPL Random Access Sequence</code></a> and
<a href="../../../../libs/mpl/doc/refmanual/extensible-sequence.html">
<code>MPL Extensible Sequence</code></a> meant to be used to specify a
compile-time list of indices as the <code>IndexSpecifierList</code> of
<code>multi_index_container</code>.
</p>
<blockquote><pre>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>T</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Ts</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>T0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Tn</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>indexed_by</span><span class=special>;</span>
</pre></blockquote>
<p>
Each user-provided element of <code>indexed_list</code> must be an index
specifier. At least an element must be provided.
specifier. At least an element must be provided. The maximum number of elements
of an <code>indexed_by</code> sequence is implementation defined.
</p>
<h2><a name="tags">Tags</a></h2>
@@ -259,7 +264,7 @@ class template <a href="#tag"><code>tag</code></a>.
<span class=keyword>namespace</span> <span class=identifier>multi_index</span><span class=special>{</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Ts</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>T0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Tn</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>tag</span><span class=special>;</span>
<span class=special>}</span> <span class=comment>// namespace boost::multi_index</span>
@@ -275,13 +280,25 @@ sequence of tags to be assigned to an index in instantiation time.
</p>
<blockquote><pre>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Ts</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>tag</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>T0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Tn</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>tag</span>
<span class=special>{</span>
<span class=keyword>typedef</span> <b>implementation defined</b> <span class=identifier>type</span><span class=special>;</span>
<span class=special>};</span>
</pre></blockquote>
<p>
Elements of <code>tag</code> can be any type, though the user is expected
to provide classes with mnemonic names. Duplicate elements are not allowed.
The maximum number of elements of a <code>tag</code> instantiation is
implementation defined.
The nested
<code>type</code> is a model of
<a href="../../../../libs/mpl/doc/refmanual/random-access-sequence.html">
<code>MPL Random Access Sequence</code></a> and
<a href="../../../../libs/mpl/doc/refmanual/extensible-sequence.html">
<code>MPL Extensible Sequence</code></a> containing the types <code>T0</code>, ... ,
<code>Tn</code> in the same order as specified.
</p>
<h2><a name="index_catalog">Indices provided by Boost.MultiIndex</a></h2>
@@ -295,7 +312,7 @@ elements, as described in the <a href="key_extraction.html">key extraction
reference</a>.
<ul>
<li><a href="ord_indices.html">Ordered indices</a> sort the elements
on the key and provide fast lookup capabilities.</li>
on the key and provide fast lookup capabilites.</li>
<li><a href="rnk_indices.html">Ranked indices</a> are a variation of
ordered indices providing extra operations based on
<i>rank</i>, the numerical position of an element
@@ -319,7 +336,7 @@ reference</a>.
<h2><a name="views">Index views</a></h2>
<p>
The following concept is used by the rearrange facilities of non-key-based
The following concept is used by the rearrange facilities of non key-based
indices. Given an index <code>i</code> of type <code>Index</code>, a <i>view
of <code>i</code></i> is any range [<code>first</code>,<code>last</code>)
where <code>first</code> and <code>last</code> are input iterators such that
@@ -369,9 +386,9 @@ Ordered indices
<br>
<p>Revised October 25th 2025</p>
<p>Revised January 9th 2020</p>
<p>&copy; Copyright 2003-2025 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">
+192 -201
View File
@@ -8,7 +8,7 @@
<link rel="start" href="../index.html">
<link rel="prev" href="rnd_indices.html">
<link rel="up" href="index.html">
<link rel="next" href="../performance.html">
<link rel="next" href="../compiler_specifics.html">
</head>
<body>
@@ -21,8 +21,8 @@ Random access indices
<div class="up_link"><a href="index.html"><img src="../up.gif" alt="Boost.MultiIndex reference" border="0"><br>
Boost.MultiIndex reference
</a></div>
<div class="next_link"><a href="../performance.html"><img src="../next.gif" alt="performance" border="0"><br>
Performance
<div class="next_link"><a href="../compiler_specifics.html"><img src="../next.gif" alt="compiler specifics" border="0"><br>
Compiler specifics
</a></div><br clear="all" style="clear: all;">
<hr>
@@ -776,7 +776,7 @@ lvalue reference to a non <code>const</code>-qualified type.
<blockquote>
<b>Requires:</b> <code>ChainedPtr</code> is a <a href="#chained_pointers">chained pointer</a>
type to <code>Value</code>.<br>
<b>Returns:</b> <code>PtrToFunction(y)</code>, where <code>y</code> is the
<b>Returns:</b> <code>PtrToFunction)(y)</code>, where <code>y</code> is the
object chained-pointed to by <code>x</code>.
</blockquote>
@@ -825,73 +825,73 @@ Type operator()(<br>
<span class=keyword>namespace</span> <span class=identifier>multi_index</span><span class=special>{</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>KeyFromValue</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>KeyFromValues</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>KeyFromValue0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>KeyFromValuen</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_result</span><span class=special>;</span>
<span class=comment>// comparison operators for composite_key_result:
<span class=comment>// comparison operators for composite_key_result:</span>
// <b>OP</b> is any of ==,&lt;,!=,&gt;,&gt;=,&lt;=</span>
<span class=comment>// <b>OP</b> is any of ==,&lt;,!=,&gt;,&gt;=,&lt;=</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey1</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey2</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <span class=identifier><b><i>OP</i></b></span><span class=special>(</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <b><i>OP</i></b><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey1</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey2</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <span class=identifier><b><i>OP</i></b></span><span class=special>(</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <b><i>OP</i></b><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <span class=identifier><b><i>OP</i></b></span><span class=special>(</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <b><i>OP</i></b><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <span class=identifier><b><i>OP</i></b></span><span class=special>(</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <b><i>OP</i></b><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <span class=identifier><b><i>OP</i></b></span><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <b><i>OP</i></b><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
<span class=comment>// equality functors:</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Pred</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Preds</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Pred0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Predn</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_equal_to</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKeyResult</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_result_equal_to</span><span class=special>;</span> <span class=comment>// deprecated
<span class=keyword>struct</span> <span class=identifier>composite_key_result_equal_to</span><span class=special>;</span> <span class=comment><b>// deprecated</b></span>
// comparison functors:</span>
<span class=comment>// comparison functors:</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Compare</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Compares</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Compare0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Comparen</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_compare</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKeyResult</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_result_less</span><span class=special>;</span> <span class=comment>// deprecated</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_result_less</span><span class=special>;</span> <span class=comment><b>// deprecated</b></span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKeyResult</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_result_greater</span><span class=special>;</span> <span class=comment>// deprecated
<span class=keyword>struct</span> <span class=identifier>composite_key_result_greater</span><span class=special>;</span> <span class=comment><b>// deprecated</b></span>
// hash functors:</span>
<span class=comment>// hash functors:</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Hash</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Hashes</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Hash0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Hashn</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_hash</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKeyResult</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_result_hash</span><span class=special>;</span> <span class=comment>// deprecated</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_result_hash</span><span class=special>;</span> <span class=comment><b>// deprecated</b></span>
<span class=special>}</span> <span class=comment>// namespace boost::multi_index</span>
<span class=special>}</span> <span class=comment>// namespace boost
<span class=special>}</span> <span class=comment>// namespace boost</span>
// specializations of external functors for composite_key_result:</span>
<span class=comment>// specializations of external functors for composite_key_result:</span>
<span class=keyword>namespace</span> <span class=identifier>std</span><span class=special>{</span>
@@ -925,23 +925,19 @@ at compile time. The returned object is of type
</p>
<blockquote><pre>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>KeyFromValue</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>KeyFromValues</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>KeyFromValue0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>KeyFromValuen</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key</span>
<span class=special>{</span>
<span class=keyword>typedef</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>KeyFromValue</span><span class=special>,</span><span class=identifier>KeyFromValues</span><span class=special>...&gt;</span> <span class=identifier>key_extractor_tuple</span><span class=special>;</span>
<span class=keyword>typedef</span> <span class=identifier>Value</span> <span class=identifier>value_type</span><span class=special>;</span>
<span class=keyword>typedef</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>composite_key</span><span class=special>&gt;</span> <span class=identifier>result_type</span><span class=special>;</span>
<span class=keyword>typedef</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>KeyFromValue0</span><span class=special>,...,</span><span class=identifier>KeyFromValuen</span><span class=special>&gt;</span> <span class=identifier>key_extractor_tuple</span><span class=special>;</span>
<span class=keyword>typedef</span> <span class=identifier>Value</span> <span class=identifier>value_type</span><span class=special>;</span>
<span class=keyword>typedef</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>composite_key</span><span class=special>&gt;</span> <span class=identifier>result_type</span><span class=special>;</span>
<span class=comment>// only provided if number of arguments is not greater than the number
// of elements and each args<sub>i</sub>&amp;&amp; is convertible to const KeyFromValues<sub>i</sub>&amp;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Args</span><span class=special>&gt;</span>
<span class=identifier>composite_key</span><span class=special>(</span><span class=identifier>Args</span><span class=special>&amp;&amp;...</span> <span class=identifier>args</span><span class=special>);</span>
<span class=identifier>composite_key</span><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>KeyFromValue0</span><span class=special>&amp;</span> <span class=identifier>k0</span><span class=special>=</span><span class=identifier>KeyFromValue0</span><span class=special>(),</span>
<span class=special>...</span>
<span class=keyword>const</span> <span class=identifier>KeyFromValuen</span><span class=special>&amp;</span> <span class=identifier>kn</span><span class=special>=</span><span class=identifier>KeyFromValuen</span><span class=special>());</span>
<span class=identifier>composite_key</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>key_extractor_tuple</span><span class=special>&amp;</span> <span class=identifier>x</span><span class=special>);</span>
<span class=comment>// only provided if number of elements is not greater than
// the maximum length of a boost::tuple</span>
<span class=identifier>composite_key</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>KeyFromValue</span><span class=special>,</span><span class=identifier>KeyFromValues</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>);</span>
<span class=keyword>const</span> <span class=identifier>key_extractor_tuple</span><span class=special>&amp;</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>&amp;</span> <span class=identifier>key_extractors</span><span class=special>()</span>
@@ -957,12 +953,14 @@ at compile time. The returned object is of type
</pre></blockquote>
<p>
<code>KeyFromValue</code> and <code>KeyFromValues...</code> are the types of
<code>KeyFromValue0</code>, ... , <code>KeyFromValuen</code> are the types of
the key extractors combined into the composite key. Each of these types
must be a <a href="#key_extractors"><code>Key Extractor</code></a> from
<code>Value</code>. <code>composite_key</code> internally stores an
<code>Value</code>. At least a key extractor must be provided. The maximum
number of key extractors of a <code>composite_key</code> instantiation is
implementation defined. <code>composite_key</code> internally stores an
object of every constituent key extractor type.
<code>composite_key&lt;Value,KeyFromValue,KeyFromValues...></code> is a model
<code>composite_key&lt;Value,KeyFromValue0,...,KeyFromValuen></code> is a model
of:
<ul>
<li><a href="#key_extractors"><code>Key Extractor</code></a>
@@ -982,19 +980,18 @@ of:
<h4><code>composite_key</code> members</h4>
<code>template&lt;typename... Args><br>
composite_key(Args&amp;&amp;... args)
<code>composite_key(<br>
&nbsp;&nbsp;const KeyFromValue0&amp; k0=KeyFromValue0(),<br>
&nbsp;&nbsp;...<br>
&nbsp;&nbsp;const KeyFromValuen&amp; kn=KeyFromValuen());
</code>
<blockquote>
<b>Effects:</b> Constructs a <code>composite_key</code> that stores
copies of <code>const KeyFromValue&amp;</code>, <code>const KeyFromValues&amp;...</code>
values each obtained from the respective value of <code>std::forward&lt;Args>(args)...</code>.
copies of the key extractor objects supplied.
</blockquote>
<code>composite_key(const key_extractor_tuple&amp; x);<br>
composite_key(const boost::tuple&lt;KeyFromValue,KeyFromValues...>&amp; x);
</code>
<code>composite_key(const key_extractor_tuple&amp; x);</code>
<blockquote>
<b>Effects:</b> Constructs a <code>composite_key</code> that stores
@@ -1076,19 +1073,19 @@ instantiations as their extracted key.
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <b><i>OP</i></b><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <b><i>OP</i></b><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span> <b><i>OP</i></b><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>);</span>
</pre></blockquote>
@@ -1114,7 +1111,7 @@ we use the following notation:
<code>x</code>,</li>
<li><code>v(x)</code> is the object of type <code>CompositeKey::value_type</code>
associated to <code>x</code>,</li>
<li><code>k<sub>i</sub>(x) = get&lt;i>(ck(x).key_extractors())</code>,
<li><code>k<sub>i</sub>(x) = ck(x).key_extractors().get&lt;i>()</code>,
that is, is the <code>i</code>-th key extractor of <code>ck(x)</code>,</li>
<li><code>x<sub>i</sub> = k<sub>i</sub>(x)(v(x))</code>, that is, the
key extracted from <code>v(x)</code> by the <code>i</code>-th key extractor,</li>
@@ -1137,17 +1134,17 @@ template&lt;typename CompositeKey,typename... Values><br>
bool operator==(<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; x,<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; y);<br>
template&lt;typename... Values,typename CompositeKey><br>
template&lt;typename CompositeKey,typename... Values><br>
bool operator==(<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; x,<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; y);<br>
template&lt;typename CompositeKey,typename... Values><br>
template&lt;typename CompositeKey,typename Value0,...,typename Valuen><br>
bool operator==(<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; x,<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; y);<br>
template&lt;typename... Values,typename CompositeKey><br>
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; y);<br>
template&lt;typename Value0,...,typename Valuen,typename CompositeKey><br>
bool operator==(<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; x,<br>
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; x,<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; y);
</code>
@@ -1163,7 +1160,7 @@ in <code>[0,length(x))</code>.
<b>Complexity:</b> No more key extraction operations and comparisons
are performed than those necessary for the evaluation of the expression above,
starting at <code>i==0</code>. The evaluation is short-circuited as soon as
the result is determined.
the result is determined to be <code>false</code>.
</blockquote>
<code>template&lt;typename CompositeKey1,typename CompositeKey2><br>
@@ -1174,17 +1171,17 @@ template&lt;typename CompositeKey,typename... Values><br>
bool operator<(<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; x,<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; y);<br>
template&lt;typename... Values,typename CompositeKey><br>
template&lt;typename CompositeKey,typename... Values><br>
bool operator<(<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; x,<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; y);<br>
template&lt;typename CompositeKey,typename... Values><br>
template&lt;typename CompositeKey,typename Value0,...,typename Valuen><br>
bool operator<(<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; x,<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; y);<br>
template&lt;typename... Values,typename CompositeKey><br>
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; y);<br>
template&lt;typename Value0,...,typename Valuen,typename CompositeKey><br>
bool operator<(<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; x,<br>
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; x,<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; y);
</code>
@@ -1215,17 +1212,17 @@ template&lt;typename CompositeKey,typename... Values><br>
bool operator <b><i>OP</i></b>(<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; x,<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; y);<br>
template&lt;typename... Values,typename CompositeKey><br>
template&lt;typename CompositeKey,typename... Values><br>
bool operator <b><i>OP</i></b>(<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; x,<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; y);<br>
template&lt;typename CompositeKey,typename... Values><br>
template&lt;typename CompositeKey,typename Value0,...,typename Valuen><br>
bool operator <b><i>OP</i></b>(<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; x,<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; y);<br>
template&lt;typename... Values,typename CompositeKey><br>
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; y);<br>
template&lt;typename Value0,...,typename Valuen,typename CompositeKey><br>
bool operator <b><i>OP</i></b>(<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; x,<br>
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; x,<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; y);
</code>
@@ -1236,7 +1233,7 @@ bool operator <b><i>OP</i></b>(<br>
<blockquote>
<b>Requires:</b> The expressions given below are valid (for the particular
<code><b><i>OP</i></b></code> considered).<br>
<code><b><i>OP</i></b></code> considered.)<br>
<b>Returns:</b> <code>true</code> if and only if
<blockquote>
<code>!(x==y)</code> (<code><b><i>OP</i></b></code> is <code>!=</code>),<br>
@@ -1259,24 +1256,20 @@ collection of elementary equality predicates.
</p>
<blockquote><pre>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Pred</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Preds</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Pred0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Predn</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_equal_to</span>
<span class=special>{</span>
<span class=keyword>typedef</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Pred</span><span class=special>,</span><span class=identifier>Preds</span><span class=special>...&gt;</span> <span class=identifier>key_eq_tuple</span><span class=special>;</span>
<span class=keyword>typedef</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Pred0</span><span class=special>,...,</span><span class=identifier>Predn</span><span class=special>&gt;</span> <span class=identifier>key_eq_tuple</span><span class=special>;</span>
<span class=comment>// only provided if number of arguments is not greater than the number
// of elements and each args<sub>i</sub>&amp;&amp; is convertible to const Preds<sub>i</sub>&amp;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Args</span><span class=special>&gt;</span>
<span class=identifier>composite_key_equal_to</span><span class=special>(</span><span class=identifier>Args</span><span class=special>&amp;&amp;...</span> <span class=identifier>args</span><span class=special>);</span>
<span class=identifier>composite_key_equal_to</span><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>Pred0</span><span class=special>&amp;</span> <span class=identifier>p0</span><span class=special>=</span><span class=identifier>Pred0</span><span class=special>(),</span>
<span class=special>...</span>
<span class=keyword>const</span> <span class=identifier>Predn</span><span class=special>&amp;</span> <span class=identifier>pn</span><span class=special>=</span><span class=identifier>Predn</span><span class=special>());</span>
<span class=identifier>composite_key_equal_to</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>key_eq_tuple</span><span class=special>&amp;</span> <span class=identifier>x</span><span class=special>);</span>
<span class=comment>// only provided if number of elements is not greater than
// the maximum length of a boost::tuple</span>
<span class=identifier>composite_key_equal_to</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Pred</span><span class=special>,</span><span class=identifier>Preds</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>);</span>
<span class=keyword>const</span> <span class=identifier>key_eq_tuple</span><span class=special>&amp;</span> <span class=identifier>key_eqs</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
<span class=identifier>key_eq_tuple</span><span class=special>&amp;</span> <span class=identifier>key_eqs</span><span class=special>();</span>
<span class=identifier>key_eq_tuple</span><span class=special>&amp;</span> <span class=identifier>key_eqs</span><span class=special>()</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey1</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey2</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
@@ -1288,35 +1281,37 @@ collection of elementary equality predicates.
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span><span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=special>};</span>
</pre></blockquote>
<p>
<code>Pred</code>, <code>Preds...</code> are the types of the equality
<code>Pred0</code>, ... , <code>Predn</code> are the types of the equality
binary predicates stored by <code>composite_key_equal_to</code>. Each of these predicates
must be <code>CopyConstructible</code> and <code>CopyAssignable</code>.
must be <code>CopyConstructible</code> and <code>CopyAssignable</code>. At least an
equality predicate must be provided. The maximum number of equality predicates of
a <code>composite_key_equal_to</code> instantiation is implementation defined.
<code>composite_key_equal_to</code> is
<code>CopyConstructible</code> and <code>CopyAssignable</code>.
It is also <code>DefaultConstructible</code>
if each <code>Preds<sub>i</sub></code> is <code>DefaultConstructible</code> in its turn.
if each <code>Predi</code> is <code>DefaultConstructible</code> in its turn.
</p>
<p>
Note that formally it is not required that the <code>Pred</code>, <code>Preds...</code> types
Note that formally it is not required that the <code>Predi</code> types
behave as equality predicates in any definite way. However, the
semantics of <code>composite_key_equal_to</code> is well defined if this
is the case, as explained in the section on the
@@ -1331,19 +1326,18 @@ introduced for <code>composite_key_result</code>.
<h4><code>composite_key_equal_to</code> members</h4>
<code>template&lt;typename... Args><br>
composite_key_equal_to(Args&amp;&amp;... args);
<code>composite_key_equal_to(<br>
&nbsp;&nbsp;const Pred0&amp; p0=Pred0(),<br>
&nbsp;&nbsp;...<br>
&nbsp;&nbsp;const Predn&amp; pn=Predn());
</code>
<blockquote>
<b>Effects:</b> Constructs a <code>composite_key_equal_to</code> that stores
copies of <code>const Pred&amp;</code>, <code>const Preds&amp;...</code> values each
obtained from the respective values of <code>std::forward&lt;Arg>(args)...</code>.
copies of the equality predicates supplied.
</blockquote>
<code>composite_key_equal_to(const key_eq_tuple&amp; x);<br>
composite_key_equal_to(const boost::tuple&lt;Pred,Preds...>&amp; x);
</code>
<code>composite_key_equal_to(const key_eq_tuple&amp; x);</code>
<blockquote>
<b>Effects:</b> Constructs a <code>composite_key_equal_to</code> that stores
@@ -1375,34 +1369,34 @@ template&lt;typename CompositeKey,typename Values...><br>
bool operator()(<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; x,<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; y)const;<br>
template&lt;typename... Values,typename CompositeKey><br>
template&lt;typename CompositeKey,typename Values...><br>
bool operator()(<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; x,<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; y)const;<br>
template&lt;typename CompositeKey,typename... Values><br>
template&lt;typename CompositeKey,typename Value0,...,typename Valuen><br>
bool operator()(<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; x,<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; y)const;<br>
template&lt;typename... Values,typename CompositeKey><br>
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; y)const;<br>
template&lt;typename Value0,...,typename Valuen,typename CompositeKey><br>
bool operator()(<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; x,<br>
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; x,<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; y)const;<br>
</code>
<blockquote>
<b>Requires:</b> <code>length(x)==length(y)</code>. The expressions
<code>get&lt;i>(key_eqs())(x<sub>i</sub>,y<sub>i</sub>)</code> and
<code>get&lt;i>(key_eqs())(y<sub>i</sub>,x<sub>i</sub>)</code>
<code>key_eqs().get&lt;i>()(x<sub>i</sub>,y<sub>i</sub>)</code> and
<code>key_eqs().get&lt;i>()(y<sub>i</sub>,x<sub>i</sub>)</code>
are valid for all <code>i</code> in <code>[0,length(x))</code>.<br>
<b>Returns:</b> <code>true</code> if and only
<blockquote>
<code>get&lt;i>(key_eqs())(x<sub>i</sub>,y<sub>i</sub>)</code>
<code>key_eqs().get&lt;i>()(x<sub>i</sub>,y<sub>i</sub>)</code>
for all <code>i</code> in <code>[0,length(x))</code>.<br>
</blockquote>
<b>Complexity:</b> No more key extraction operations and comparisons
are performed than those necessary for the evaluation of the expression above,
starting at <code>i==0</code>. The evaluation is short-circuited as soon as
the result is determined.
the result is determined to be <code>false</code>.
</blockquote>
<h4><a name="composite_key_result_equal_to">Class template
@@ -1445,19 +1439,19 @@ are instantiations of <code>std::equal_to</code>.
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Values</span><span class=special>...,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Values</span><span class=special>...,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=special>};</span>
@@ -1497,24 +1491,20 @@ collection of elementary comparison predicates.
</p>
<blockquote><pre>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Compare</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Compares</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Compare0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Comparen</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_compare</span>
<span class=special>{</span>
<span class=keyword>typedef</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Compare</span><span class=special>,</span><span class=identifier>Compares</span><span class=special>...&gt;</span> <span class=identifier>key_comp_tuple</span><span class=special>;</span>
<span class=keyword>typedef</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Compare0</span><span class=special>,...,</span><span class=identifier>Comparen</span><span class=special>&gt;</span> <span class=identifier>key_comp_tuple</span><span class=special>;</span>
<span class=identifier>composite_key_compare</span><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>Compare0</span><span class=special>&amp;</span> <span class=identifier>c0</span><span class=special>=</span><span class=identifier>Compare0</span><span class=special>(),</span>
<span class=special>...</span>
<span class=keyword>const</span> <span class=identifier>Comparen</span><span class=special>&amp;</span> <span class=identifier>cn</span><span class=special>=</span><span class=identifier>Comparen</span><span class=special>());</span>
<span class=comment>// only provided if number of arguments is not greater than the number
// of elements and each args<sub>i</sub>&amp;&amp; is convertible to const Compares<sub>i</sub>&amp;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Args</span><span class=special>&gt;</span>
<span class=identifier>composite_key_compare</span><span class=special>(</span><span class=identifier>Args</span><span class=special>&amp;&amp;...</span> <span class=identifier>args</span><span class=special>);</span>
<span class=identifier>composite_key_compare</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>key_comp_tuple</span><span class=special>&amp;</span> <span class=identifier>x</span><span class=special>);</span>
<span class=comment>// only provided if number of elements is not greater than
// the maximum length of a boost::tuple</span>
<span class=identifier>composite_key_compare</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Compare</span><span class=special>,</span><span class=identifier>Compares</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>);</span>
<span class=keyword>const</span> <span class=identifier>key_comp_tuple</span><span class=special>&amp;</span> <span class=identifier>key_comps</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
<span class=identifier>key_comp_tuple</span><span class=special>&amp;</span> <span class=identifier>key_comps</span><span class=special>();</span>
<span class=identifier>key_comp_tuple</span><span class=special>&amp;</span> <span class=identifier>key_comps</span><span class=special>()</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey1</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey2</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
@@ -1526,19 +1516,19 @@ collection of elementary comparison predicates.
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value</span><span class=special>&gt;</span>
@@ -1552,18 +1542,20 @@ collection of elementary comparison predicates.
</pre></blockquote>
<p>
<code>Compare</code>, <code>Compares...</code> are the types of the comparison
<code>Compare0</code>, ... , <code>Comparen</code> are the types of the comparison
binary predicates stored by <code>composite_key_compare</code>. Each of these predicates must be
<code>CopyConstructible</code> and <code>CopyAssignable</code>
<code>CopyConstructible</code> and <code>CopyAssignable</code>. At least a
comparison predicate must be provided. The maximum number of comparison predicates of
a <code>composite_key_compare</code> instantiation is implementation defined.
<code>composite_key_compare</code> is
<code>CopyConstructible</code> and <code>CopyAssignable</code>.
It is also
<code>DefaultConstructible</code>
if each <code>Compares<sub>i</sub></code> is <code>DefaultConstructible</code> in its turn.
if each <code>Comparei</code> is <code>DefaultConstructible</code> in its turn.
</p>
<p>
Note that formally it is not required that the <code>Compare</code>, <code>Compares...</code> types
Note that formally it is not required that the <code>Comparei</code> types
behave as comparison predicates in any definite way. However, the
semantics of <code>composite_key_compare</code> is well defined if this
is the case, as explained in the section on the
@@ -1578,19 +1570,18 @@ introduced for <code>composite_key_result</code>.
<h4><code>composite_key_compare</code> members</h4>
<code>template&lt;typename... Args><br>
composite_key_compare(Args&amp;&amp;... args);
<code>composite_key_compare(<br>
&nbsp;&nbsp;const Compare0&amp; c0=Compare0(),<br>
&nbsp;&nbsp;...<br>
&nbsp;&nbsp;const Comparen&amp; cn=Comparen());
</code>
<blockquote>
<b>Effects:</b> Constructs a <code>composite_key_compare</code> that stores
copies of <code>const Compare&amp;</code>, <code>const Compares&amp;...</code>
values each obtained from the respective values of <code>std::forward&lt;Arg>(args)...</code>.
copies of the comparison predicates supplied.
</blockquote>
<code>composite_key_compare(const key_comp_tuple&amp; x);<br>
composite_key_compare(const boost::tuple&lt;Compare,Compares...>&amp; x)
</code>
<code>composite_key_compare(const key_comp_tuple&amp; x);</code>
<blockquote>
<b>Effects:</b> Constructs a <code>composite_key_compare</code> that stores
@@ -1622,38 +1613,38 @@ template&lt;typename CompositeKey,typename... Values><br>
bool operator()(<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; x,<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; y)const;<br>
template&lt;typename... Values,typename CompositeKey><br>
template&lt;typename CompositeKey,typename... Values><br>
bool operator()(<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; x,<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; y)const;<br>
template&lt;typename CompositeKey,typename... Values><br>
template&lt;typename CompositeKey,typename Value0,...,typename Valuen><br>
bool operator()(<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; x,<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; y)const;<br>
template&lt;typename... Values,typename CompositeKey><br>
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; y)const;<br>
template&lt;typename Value0,...,typename Valuen,typename CompositeKey><br>
bool operator()(<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; x,<br>
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; x,<br>
&nbsp;&nbsp;const composite_key_result&lt;CompositeKey>&amp; y)const;<br>
</code>
<blockquote>
<b>Requires:</b> The expressions
<code>get&lt;i>(key_comps())(x<sub>i</sub>,y<sub>i</sub>)</code> and
<code>get&lt;i>(key_comps())(y<sub>i</sub>,x<sub>i</sub>)</code>
<code>key_comps().get&lt;i>()(x<sub>i</sub>,y<sub>i</sub>)</code> and
<code>key_comps().get&lt;i>()(y<sub>i</sub>,x<sub>i</sub>)</code>
are valid for all <code>i</code>
in <code>[0,min(length(x),length(y)))</code>.<br>
<b>Returns:</b> <code>true</code> if and only if there exists some
<code>j</code> in the range <code>[0,min(length(x),length(y)))</code>
such that
<blockquote>
<code>!get&lt;i>(key_comps())(x<sub>i</sub>,y<sub>i</sub>) &amp;&amp; !get&lt;i>(key_comps())(y<sub>i</sub>,x<sub>i</sub>)</code>
<code>!key_comps().get&lt;i>()(x<sub>i</sub>,y<sub>i</sub>) &amp;&amp; !key_comps().get&lt;i>()(y<sub>i</sub>,x<sub>i</sub>)</code>
for all <code>i</code> in <code>[0,j)</code>,<br>
<code>&nbsp;get&lt;j>(key_comps())(x<sub>j</sub>,y<sub>j</sub>)</code>.
<code>&nbsp;key_comps().get&lt;j>()(x<sub>j</sub>,y<sub>j</sub>)</code>.
</blockquote>
<b>Complexity:</b> No more key extraction operations and comparisons
are performed than those necessary for the evaluation of the expression above,
starting at <code>i==0</code>. The evaluation is short-circuited as soon as
the result is determined.
the result is determined to be <code>false</code>.
</blockquote>
<code>
@@ -1728,19 +1719,19 @@ instantiations of <code>std::less</code>.
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value</span><span class=special>&gt;</span>
@@ -1788,6 +1779,7 @@ an instantiation of <code>composite_key_result</code>, behaves as a particulariz
are instantiations of <code>std::greater</code>.
</p>
<blockquote><pre>
<span class=keyword>namespace</span> <span class=identifier>std</span><span class=special>{</span>
@@ -1810,19 +1802,19 @@ are instantiations of <code>std::greater</code>.
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=keyword>bool</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>,</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>multi_index</span><span class=special>::</span><span class=identifier>composite_key_result</span><span class=special>&lt;</span><span class=identifier>CompositeKey</span><span class=special>&gt;&amp;</span> <span class=identifier>y</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>,</span><span class=keyword>typename</span> <span class=identifier>Value</span><span class=special>&gt;</span>
@@ -1871,24 +1863,20 @@ instantiations based on a collection of elementary hash functors.
</p>
<blockquote><pre>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Hash</span><span class=special>,</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Hashes</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Hash0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Hashn</span><span class=special>&gt;</span>
<span class=keyword>struct</span> <span class=identifier>composite_key_hash</span>
<span class=special>{</span>
<span class=keyword>typedef</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Hash</span><span class=special>,</span><span class=identifier>Hashes</span><span class=special>...&gt;</span> <span class=identifier>key_hasher_tuple</span><span class=special>;</span>
<span class=keyword>typedef</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Hash0</span><span class=special>,...,</span><span class=identifier>Hashn</span><span class=special>&gt;</span> <span class=identifier>key_hasher_tuple</span><span class=special>;</span>
<span class=identifier>composite_key_hash</span><span class=special>(</span>
<span class=keyword>const</span> <span class=identifier>Hash0</span><span class=special>&amp;</span> <span class=identifier>h0</span><span class=special>=</span><span class=identifier>Hash0</span><span class=special>(),</span>
<span class=special>...</span>
<span class=keyword>const</span> <span class=identifier>Hashn</span><span class=special>&amp;</span> <span class=identifier>hn</span><span class=special>=</span><span class=identifier>Hashn</span><span class=special>());</span>
<span class=comment>// only provided if number of arguments is not greater than the number
// of elements and each args<sub>i</sub>&amp;&amp; is convertible to const Hashes<sub>i</sub>&amp;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Args</span><span class=special>&gt;</span>
<span class=identifier>composite_key_hash</span><span class=special>(</span><span class=identifier>Args</span><span class=special>&amp;&amp;...</span> <span class=identifier>args</span><span class=special>);</span>
<span class=identifier>composite_key_hash</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>key_hasher_tuple</span><span class=special>&amp;</span> <span class=identifier>x</span><span class=special>);</span>
<span class=comment>// only provided if number of elements is not greater than
// the maximum length of a boost::tuple</span>
<span class=identifier>composite_key_hash</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Hash</span><span class=special>,</span><span class=identifier>Hashes</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>);</span>
<span class=keyword>const</span> <span class=identifier>key_hasher_tuple</span><span class=special>&amp;</span> <span class=identifier>key_hash_functions</span><span class=special>()</span><span class=keyword>const</span><span class=special>;</span>
<span class=identifier>key_hasher_tuple</span><span class=special>&amp;</span> <span class=identifier>key_hash_functions</span><span class=special>();</span>
<span class=identifier>key_hasher_tuple</span><span class=special>&amp;</span> <span class=identifier>key_hash_functions</span><span class=special>()</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>CompositeKey</span><span class=special>&gt;</span>
<span class=identifier>std</span><span class=special>::</span><span class=identifier>size_t</span> <span class=keyword>operator</span><span class=special>()(</span>
@@ -1898,22 +1886,24 @@ instantiations based on a collection of elementary hash functors.
<span class=identifier>std</span><span class=special>::</span><span class=identifier>size_t</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>&gt;</span>
<span class=identifier>std</span><span class=special>::</span><span class=identifier>size_t</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</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>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=special>};</span>
</pre></blockquote>
<p>
<code>Hash</code>, <code>Hashes...</code> are the types of the hash unary function objects
<code>Hash0</code>, ... , <code>Hashn</code> are the types of the hash unary function objects
stored by <code>composite_key_hash</code>. Each of these objects
must be <code>CopyConstructible</code> and <code>CopyAssignable</code>
and return a value of type <code>std::size_t</code> in the range
[0, <code>std::numeric_limits&lt;std::size_t&gt;::max())</code>).
At least a hash functor must be provided. The maximum number of hash functors of
a <code>composite_key_hash</code> instantiation is implementation defined.
<code>composite_key_hash</code> is
<code>CopyConstructible</code> and <code>CopyAssignable</code>.
It is also <code>DefaultConstructible</code>
if each <code>Hash</code>, <code>Hashes...</code> is <code>DefaultConstructible</code> in its turn.
if each <code>Hashi</code> is <code>DefaultConstructible</code> in its turn.
</p>
<h4>Notation</h4>
@@ -1924,19 +1914,18 @@ introduced for <code>composite_key_result</code>.
<h4><code>composite_key_hash</code> members</h4>
<code>template&lt;typename... Args><br>
composite_key_hash(Args&amp;&amp;... args);
<code>composite_key_hash(<br>
&nbsp;&nbsp;const Hash0&amp; h0=Hash0(),<br>
&nbsp;&nbsp;...<br>
&nbsp;&nbsp;const Hashn&amp; hn=Hashn());
</code>
<blockquote>
<b>Effects:</b> Constructs a <code>composite_key_hash</code> that stores
copies of <code>const Hash&amp;</code>, <code>const Hashes&amp;...</code>
values each obtained from the respective values of <code>std::forward&lt;Args>(args)...</code>.
copies of the hash functors supplied.
</blockquote>
<code>composite_key_hash(const key_hasher_tuple&amp; x);<br>
composite_key_hash(const boost::tuple&lt;Hash,Hashes...>&amp; x);
</code>
<code>composite_key_hash(const key_hasher_tuple&amp; x);</code>
<blockquote>
<b>Effects:</b> Constructs a <code>composite_key_hash</code> that stores
@@ -1966,23 +1955,23 @@ bool operator()(<br>
template&lt;typename... Values><br>
bool operator()(<br>
&nbsp;&nbsp;const std::tuple&lt;Values...>&amp; x)const;<br>
template&lt;typename... Values><br>
template&lt;typename Value0,...,typename Valuen><br>
bool operator()(<br>
&nbsp;&nbsp;const boost::tuple&lt;Values...>&amp; x)const;
&nbsp;&nbsp;const boost::tuple&lt;Value0,...,Valuen>&amp; x)const;
</code>
<blockquote>
<b>Requires:</b> <code>length(x)==length(key_hash_functions())</code>.
The expression
<code>get&lt;i>(key_hash_functions())(x<sub>i</sub>)</code>
<code>key_hash_functions().get&lt;i>()(x<sub>i</sub>)</code>
is valid for all <code>i</code> in <code>[0,length(x))</code>.
<br>
<b>Returns:</b> A value in the range
<code>[0, std::numeric_limits&lt;std::size_t&gt;::max())</code> that
solely depends on the numerical tuple
<blockquote>
(<code>get&lt;0>(key_hash_functions())(x<sub>0</sub>)</code>, ... ,
<code>get&lt;N>(key_hash_functions())(x<sub>N</sub>)</code>),
(<code>key_hash_functions().get&lt;0>()(x<sub>0</sub>)</code>, ... ,
<code>key_hash_functions().get&lt;N>()(x<sub>N</sub>)</code>),
with <code>N=length(x)-1</code>.
</blockquote>
</blockquote>
@@ -2023,9 +2012,9 @@ are instantiations of
<span class=identifier>std</span><span class=special>::</span><span class=identifier>size_t</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span><span class=special>...</span> <span class=identifier>Values</span><span class=special>&gt;</span>
<span class=keyword>template</span><span class=special>&lt;</span><span class=keyword>typename</span> <span class=identifier>Value0</span><span class=special>,...,</span><span class=keyword>typename</span> <span class=identifier>Valuen</span><span class=special>&gt;</span>
<span class=identifier>std</span><span class=special>::</span><span class=identifier>size_t</span> <span class=keyword>operator</span><span class=special>()(</span>
<span class=keyword>const</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Values</span><span class=special>...&gt;&amp;</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>boost</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>Value0</span><span class=special>,...,</span><span class=identifier>Valuen</span><span class=special>&gt;&amp;</span> <span class=identifier>x</span><span class=special>)</span><span class=keyword>const</span><span class=special>;</span>
<span class=special>};</span>
<span class=special>}</span> <span class=comment>// namespace boost</span>
@@ -2089,7 +2078,7 @@ with respect to <code>composite_key_result&lt;CompositeKey></code>:
<blockquote>
<code>tuple&lt;Q0,...,Qj></code>,<br>
<code>composite_key_result&lt;composite_key&lt;K0,...,Kj> ></code>, with
<code>Ki::result_type = Qi</code> for all <code>i = 0,...,j</code>,
<code>Ki::result_type = Qi</code> for all <code>i = 0,...,j</code>.
</blockquote>
provided that each <code>Qi</code> is either <code>Ti</code> or a
<a href="hash_indices.html#lookup"><code>Compatible Key</code></a>
@@ -2108,9 +2097,9 @@ is lexicographical. Also, the following types are
<code>composite_key_compare</code> with respect to
<code>composite_key_result&lt;CompositeKey></code>:
<blockquote>
<code>tuple&lt;Q0,...,Qk></code>, <code>k &lt;= n</code>,<br>
<code>tuple&lt;Q0,...,Qk></code>, <code>k &lt;= n</code><br>
<code>composite_key_result&lt;composite_key&lt;K0,...,Kk> ></code>, with
<code>Ki::result_type = Qi</code> for all <code>i = 0,...,k</code>,
<code>Ki::result_type = Qi</code> for all <code>i = 0,...,k</code>.
</blockquote>
provided that
<ul>
@@ -2174,7 +2163,9 @@ subsets of those associated to <code>!(x&lt;y)&amp;&amp;!(y&lt;x)</code>.
<p>
In C++17 compliant environments, <code>key</code> provides a very terse syntax for
the specification of Boost.MultiIndex predefined key extractors. The number of template
arguments passed to <code>key</code> must be greater than zero. <code>key&lt;Key&gt;</code>
arguments passed to <code>key</code> must be greater than zero and not exceed the
maximum number of key extractors accepted by
<a href="#composite_key"><code>composite_key</code></a>. <code>key&lt;Key&gt;</code>
resolves to:
<ul>
<li><a href="#member"><code>member&lt;Class,Type,Key&gt;</code></a>
@@ -2223,7 +2214,7 @@ and engenders undefined behavior otherwise. When passed two or more arguments,
with:
<ul>
<li><code>KeyFromValuei</code> = <code>key&lt;Keyi&gt;</code>
for all <code>i = 0,...,n</code>,
for all <code>i = 0,...,n</code>
</li>
<li><code>Value</code> = <code>std::decay_t&lt;Value0&gt;</code> &#8855;
<code>std::decay_t&lt;Value1&gt;</code> &#8855; &middot;&middot;&middot; &#8855;
@@ -2246,15 +2237,15 @@ Random access indices
<div class="up_link"><a href="index.html"><img src="../up.gif" alt="Boost.MultiIndex reference" border="0"><br>
Boost.MultiIndex reference
</a></div>
<div class="next_link"><a href="../performance.html"><img src="../next.gif" alt="performance" border="0"><br>
Performance
<div class="next_link"><a href="../compiler_specifics.html"><img src="../next.gif" alt="compiler specifics" border="0"><br>
Compiler specifics
</a></div><br clear="all" style="clear: all;">
<br>
<p>Revised November 7th 2025</p>
<p>Revised April 19th 2020</p>
<p>&copy; Copyright 2003-2025 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">
+40 -30
View File
@@ -235,15 +235,16 @@ and for access to the indices held.
<p>
A <code>multi_index_container</code> type is instantiated with the type of the
elements contained and a non-empty
<a href="../../../../libs/mp11/doc/html/mp11.html#definitions">Mp11 list</a>
specifying which indices conform the class.
<a href="../../../../libs/mpl/doc/refmanual/forward-sequence.html">
<code>MPL Forward Sequence</code></a> specifying which indices conform the
class.
</p>
<p>
For convenience of use, all public methods and types of the first index
specified are inherited by <code>multi_index_container</code>. This also includes global
operators and functions associated with the index (vg. comparison and
<code>swap</code>).
<code>swap</code>.)
</p>
<blockquote><pre>
@@ -388,7 +389,7 @@ operators and functions associated with the index (vg. comparison and
<span class=special>&gt;::</span><span class=identifier>type</span><span class=special>&amp;</span>
<span class=identifier>get</span><span class=special>(</span><span class=identifier>multi_index_container</span><span class=special>&lt;</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>&gt;&amp;</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span>
<span class=special>{</span>
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=keyword>template</span> <span class=identifier>get</span><span class=special>&lt;</span><span class=identifier>N</span><span class=special>&gt;();</span>
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=identifier>get</span><span class=special>&lt;</span><span class=identifier>N</span><span class=special>&gt;();</span>
<span class=special>}</span>
<span class=keyword>template</span><span class=special>&lt;</span>
@@ -399,7 +400,7 @@ operators and functions associated with the index (vg. comparison and
<span class=special>&gt;::</span><span class=identifier>type</span><span class=special>&amp;</span>
<span class=identifier>get</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>multi_index_container</span><span class=special>&lt;</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>&gt;&amp;</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span>
<span class=special>{</span>
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=keyword>template</span> <span class=identifier>get</span><span class=special>&lt;</span><span class=identifier>N</span><span class=special>&gt;();</span>
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=identifier>get</span><span class=special>&lt;</span><span class=identifier>N</span><span class=special>&gt;();</span>
<span class=special>}</span>
<span class=keyword>template</span><span class=special>&lt;</span>
@@ -410,7 +411,7 @@ operators and functions associated with the index (vg. comparison and
<span class=special>&gt;::</span><span class=identifier>type</span><span class=special>&amp;</span>
<span class=identifier>get</span><span class=special>(</span><span class=identifier>multi_index_container</span><span class=special>&lt;</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>&gt;&amp;</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span>
<span class=special>{</span>
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=keyword>template</span> <span class=identifier>get</span><span class=special>&lt;</span><span class=identifier>Tag</span><span class=special>&gt;();</span>
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=identifier>get</span><span class=special>&lt;</span><span class=identifier>Tag</span><span class=special>&gt;();</span>
<span class=special>}</span>
<span class=keyword>template</span><span class=special>&lt;</span>
@@ -421,7 +422,7 @@ operators and functions associated with the index (vg. comparison and
<span class=special>&gt;::</span><span class=identifier>type</span><span class=special>&amp;</span>
<span class=identifier>get</span><span class=special>(</span><span class=keyword>const</span> <span class=identifier>multi_index_container</span><span class=special>&lt;</span><span class=identifier>Value</span><span class=special>,</span><span class=identifier>IndexSpecifierList</span><span class=special>,</span><span class=identifier>Allocator</span><span class=special>&gt;&amp;</span> <span class=identifier>m</span><span class=special>)</span><span class=keyword>noexcept</span>
<span class=special>{</span>
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=keyword>template</span> <span class=identifier>get</span><span class=special>&lt;</span><span class=identifier>Tag</span><span class=special>&gt;();</span>
<span class=keyword>return</span> <span class=identifier>m</span><span class=special>.</span><span class=identifier>get</span><span class=special>&lt;</span><span class=identifier>Tag</span><span class=special>&gt;();</span>
<span class=special>}</span>
<span class=comment>// multi_index_container global functions for projection of iterators:</span>
@@ -530,10 +531,13 @@ scheme outlined in the
</li>
<li><code>IndexSpecifierList</code> specifies the indices that the
<code>multi_index_container</code> is composed of. It must be a non-empty
<a href="../../../../libs/mp11/doc/html/mp11.html#definitions">Mp11 list</a>
of index specifiers. For syntactic convenience, the
<a href="../../../../libs/mpl/doc/refmanual/forward-sequence.html">
<code>MPL Forward Sequence</code></a> (and, preferrably,
an <a href="../../../../libs/mpl/doc/refmanual/random-access-sequence.html">
<code>MPL Random Access Sequence</code></a>) of index specifiers. For
syntactic convenience, the
<a href="indices.html#indexed_by"><code>indexed_by</code></a>
construct can be used.
MPL sequence can be used.
</li>
<li><code>Allocator</code> must be an allocator of <code>Value</code> objects
satisfying the associated C++ requirements at <b>[allocator.requirements]</b>.
@@ -552,11 +556,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.
@@ -597,16 +598,22 @@ Same type as <code>IndexSpecifierList</code>.
<code>index_type_list</code>
<blockquote>
<a href="../../../../libs/mp11/doc/html/mp11.html#definitions">Mp11 list</a>
containing the types of the indices held by
Model of
<a href="../../../../libs/mpl/doc/refmanual/random-access-sequence.html">
<code>MPL Random Access Sequence</code></a> and
<a href="../../../../libs/mpl/doc/refmanual/extensible-sequence.html">
<code>MPL Extensible Sequence</code></a> containing the types of the indices held by
the <code>multi_index_container</code>, in the same order as they were specified.
</blockquote>
<code>iterator_type_list</code>
<blockquote>
<a href="../../../../libs/mp11/doc/html/mp11.html#definitions">Mp11 list</a>
containing the types of the iterators of
Model of
<a href="../../../../libs/mpl/doc/refmanual/random-access-sequence.html">
<code>MPL Random Access Sequence</code></a> and
<a href="../../../../libs/mpl/doc/refmanual/extensible-sequence.html">
<code>MPL Extensible Sequence</code></a> containing the types of the iterators of
the indices held by the <code>multi_index_container</code>, in the same order as they were
specified.
</blockquote>
@@ -614,8 +621,11 @@ specified.
<code>const_iterator_type_list</code>
<blockquote>
<a href="../../../../libs/mp11/doc/html/mp11.html#definitions">Mp11 list</a>
containing the types of the constant
Model of
<a href="../../../../libs/mpl/doc/refmanual/random-access-sequence.html">
<code>MPL Random Access Sequence</code></a> and
<a href="../../../../libs/mpl/doc/refmanual/extensible-sequence.html">
<code>MPL Extensible Sequence</code></a> containing the types of the constant
iterators of the indices held by the <code>multi_index_container</code>, in the same order
as they were specified.
</blockquote>
@@ -728,7 +738,7 @@ multi_index_container(<br>
<code>EmplaceConstructible</code> into <code>multi_index_container</code>
from <code>*first</code>.
<code>last</code> is reachable from <code>first</code>.<br>
<b>Effects:</b> Constructs an empty <code>multi_index_container</code> using the
<b>Effects:</b> Constructs and empty <code>multi_index_container</code> using the
specified argument list and allocator and fills it with
the elements in the range [<code>first</code>,<code>last</code>).
Insertion of each element may or may not succeed depending
@@ -755,7 +765,7 @@ the number of elements in [<code>first</code>,<code>last</code>).<br>
<code>multi_index_container</code>.<br>
<b>Effects:</b> Constructs a copy of <code>x</code>, copying its
elements as well as its internal objects (those specified
in <code>ctor_args_list</code> and the allocator).<br>
in <code>ctor_args_list</code> and the allocator.)<br>
<b>Postconditions:</b> <code>*this==x</code>. The order on every index
of the <code>multi_index_container</code> is preserved as well.<br>
<b>Complexity:</b> <code>O(x.size()*log(x.size()) + C(x.size()))</code>.
@@ -767,7 +777,7 @@ of the <code>multi_index_container</code> is preserved as well.<br>
<blockquote>
<b>Effects:</b> Constructs a <code>multi_index_container</code> by transferring the
elements of <code>x</code> and copying its internal objects (those specified
in <code>ctor_args_list</code> and the allocator).<br>
in <code>ctor_args_list</code> and the allocator.)<br>
<b>Postconditions:</b> If <code>x==y</code> just
before the movement, <code>*this==y</code>. The order on every index
of the <code>multi_index_container</code> is preserved as well.<br>
@@ -873,7 +883,7 @@ of the types of <code>ctor_args_list</code> do not throw.
<blockquote>
<b>Requires:</b> <code>Value</code> is <code>CopyInsertable</code> into
<code>multi_index_container</code>.<br>
<b>Effects:</b> Replaces the elements of the <code>multi_index_container</code>
<b>Effects:</b> Replaces the elements the <code>multi_index_container</code>
with copies of the elements of <code>list</code>, inserted in the specified order.
Insertion of each element may or may not succeed depending
on the acceptance by all the indices of the <code>multi_index_container</code>.<br>
@@ -955,7 +965,7 @@ typename nth_index&lt;N>::type::iterator project(IteratorType it);</code>
<b>Requires:</b> <code>0 &lt;= N &lt; I-1</code>. <code>IteratorType</code>
belongs to <code>iterator_type_list</code>. <code>it</code> is a valid
iterator of some index of <code>*this</code> (i.e. does not refer to some
other <code>multi_index_container</code>).<br>
other <code>multi_index_container</code>.)<br>
<b>Effects:</b> Returns an <code>nth_index&lt;N>::type::iterator</code>
equivalent to <code>it</code>.<br>
<b>Complexity:</b> Constant.<br>
@@ -985,7 +995,7 @@ typename index&lt;Tag>::type::iterator project(IteratorType it);</code>
<code>index&lt;Tag>::type</code> is valid. <code>IteratorType</code>
belongs to <code>iterator_type_list</code>. <code>it</code> is a valid
iterator of some index of <code>*this</code> (i.e. does not refer to some
other <code>multi_index_container</code>).<br>
other <code>multi_index_container</code>.)<br>
<b>Effects:</b> Returns an <code>index&lt;Tag>::type::iterator</code>
equivalent to <code>it</code>.<br>
<b>Complexity:</b> Constant.<br>
@@ -1001,7 +1011,7 @@ typename index&lt;Tag>::type::const_iterator project(IteratorType it)const;</cod
belongs to <code>const_iterator_type_list</code> or
<code>iterator_type_list</code>. <code>it</code> is a valid
(constant or non-constant) iterator of some index of <code>*this</code>
(i.e. does not refer to some other <code>multi_index_container</code>).<br>
(i.e. does not refer to some other <code>multi_index_container</code>.)<br>
<b>Effects:</b> Returns an <code>index&lt;Tag>::type::const_iterator</code>
iterator equivalent to <code>it</code>.<br>
<b>Complexity:</b> Constant.<br>
@@ -1043,7 +1053,7 @@ output archive (XML archive) <code>ar</code>.
<blockquote>
<b>Requires:</b> <code>Value</code> is serializable (XML-serializable). Additionally,
each of the indices of <code>m</code> can impose other requirements.<br>
each of the indices of <code>m</code> can impose another requirements.<br>
<b>Exception safety:</b> Strong with respect to <code>m</code>. If an exception
is thrown, <code>ar</code> may be left in an inconsistent state.
</blockquote>
@@ -1053,7 +1063,7 @@ input archive (XML archive) <code>ar</code>.
<blockquote>
<b>Requires:</b> <code>Value</code> is serializable (XML-serializable). Additionally,
each of the indices of <code>m'</code> can impose other requirements.<br>
each of the indices of <code>m'</code> can impose another requirements.<br>
<b>Exception safety:</b> Basic. If an exception is thrown, <code>ar</code> may be
left in an inconsistent state.
</blockquote>
@@ -1072,9 +1082,9 @@ Index reference
<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">
+2 -2
View File
@@ -196,7 +196,7 @@ together, with minor differences explicitly stated when they exist.
Except where noted or if the corresponding interface does not exist,
ordered indices (both unique and non-unique) satisfy the C++ requirements
for associative containers at <b>[associative.reqmts]</b>
(supporting unique and equivalent keys, respectively).
(supporting unique and equivalent keys, respectively.)
Iterators (including to the end of the index) and pointers and references to an element
remain valid during the lifetime of the associated container (which can change
upon swapping), or until the referred-to element is erased or extracted;
@@ -1324,7 +1324,7 @@ Operation: loading of an <code>iterator</code> or <code>const_iterator</code>
then <code>*it'</code> is the restored copy of <code>*it</code>, otherwise
<code>it'==end()</code>.<br>
<b>Note:</b> It is allowed that <code>it</code> be a <code>const_iterator</code>
and the restored <code>it'</code> an <code>iterator</code>, or vice versa.
and the restored <code>it'</code> an <code>iterator</code>, or viceversa.
</blockquote>
<hr>
+5 -5
View File
@@ -178,7 +178,7 @@ plus the requirements for <code>std::list</code> specific list operations at
have <code>data</code> member functions.
</li>
<li>The complexities of some operations, notably insertion and deletion, differ
<li>The complexity of some operations, notably insertion and deletion, differ
from those of <code>std::vector</code>.
</li>
<li>Unlike as in <code>std::vector</code>, insertions into a random access index
@@ -439,7 +439,7 @@ of the complexity formulas:
<p>
(<code>shl</code> and <code>rel</code> stand for <i>shift left</i> and
<i>relocate</i>, respectively).
<i>relocate</i>, respectively.)
</p>
<h4><a name="instantiation_types">Instantiation types</a></h4>
@@ -550,7 +550,7 @@ const_iterator iterator_to(const value_type&amp; x)const;</code>
<code>size()&lt;c</code>, back insertions happen in constant time (the
general case as described by
<a href="#complexity_signature"><code>i(n)</code></a> is <i>amortized</i>
constant time).<br>
constant time.)<br>
<b>Note:</b> Validity of iterators and references to elements
is preserved in all insertions, regardless of the capacity status.
</blockquote>
@@ -590,7 +590,7 @@ into <code>multi_index_container</code>.<br>
elements (first version) or copies of <code>x</code> (second version) at the end of
the index. If <code>n&lt;size()</code>, erases the last <code>size()-n</code> elements.<br>
<b>Note:</b> If an expansion is requested, the size of the index is not guaranteed
to be <code>n</code> after this operation (other indices may ban insertions).
to be <code>n</code> after this operation (other indices may ban insertions.)
</blockquote>
<h4><a name="modifiers">Modifiers</a></h4>
@@ -1223,7 +1223,7 @@ Operation: loading of an <code>iterator</code> or <code>const_iterator</code>
then <code>*it'</code> is the restored copy of <code>*it</code>, otherwise
<code>it'==end()</code>.<br>
<b>Note:</b> It is allowed that <code>it</code> be a <code>const_iterator</code>
and the restored <code>it'</code> an <code>iterator</code>, or vice versa.
and the restored <code>it'</code> an <code>iterator</code>, or viceversa.
</blockquote>
<hr>
+2 -2
View File
@@ -525,7 +525,7 @@ into <code>multi_index_container</code>.<br>
elements (first version) or copies of <code>x</code> (second version) at the end of
the index. If <code>n&lt;size()</code>, erases the last <code>size()-n</code> elements.<br>
<b>Note:</b> If an expansion is requested, the size of the index is not guaranteed
to be <code>n</code> after this operation (other indices may ban insertions).
to be <code>n</code> after this operation (other indices may ban insertions.)
</blockquote>
<h4><a name="modifiers">Modifiers</a></h4>
@@ -1158,7 +1158,7 @@ Operation: loading of an <code>iterator</code> or <code>const_iterator</code>
then <code>*it'</code> is the restored copy of <code>*it</code>, otherwise
<code>it'==end()</code>.<br>
<b>Note:</b> It is allowed that <code>it</code> be a <code>const_iterator</code>
and the restored <code>it'</code> an <code>iterator</code>, or vice versa.
and the restored <code>it'</code> an <code>iterator</code>, or viceversa.
</blockquote>
<hr>
+5 -122
View File
@@ -30,13 +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>
<li><a href="#boost_1_83">Boost 1.83 release</a></li>
<li><a href="#boost_1_82">Boost 1.82 release</a></li>
<li><a href="#boost_1_81">Boost 1.81 release</a></li>
<li><a href="#boost_1_80">Boost 1.80 release</a></li>
<li><a href="#boost_1_79">Boost 1.79 release</a></li>
<li><a href="#boost_1_78">Boost 1.78 release</a></li>
@@ -74,117 +67,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>
<ul>
<li><b>Breaking change:</b> All type lists accepted or provided by the library (<code>indexed_by</code>,
<code>tag</code>, nested typedefs <code>index_specifier_type_list</code>,
<code>index_type_list</code>, <code>iterator_type_list</code> and
<code>const_iterator_type_list</code>) are no longer based on
<a href="../../mpl">Boost.MPL</a> but instead they are now
<a href="../../mp11/doc/html/mp11.html#definitions">Boost.Mp11 lists</a>.
As a result, Boost.MultiIndex doesn't depend anymore on Boost.MPL.
It is expected that most user code won't be impacted by this
change, but the previous behavior may be restored, however, by
globally defining the macro
<code>BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT</code>.
Legacy support for Boost.MPL may be eventually deprecated and removed in the future.
</li>
<li><b>Breaking change:</b> <code>composite_key</code> and associated
class templates (<code>composite_key_equal_to</code>, <code>composite_key_compare</code>,
<code>composite_key_hash</code>) have been made variadic (previously the maximum
number of template arguments was limited by <code>BOOST_MULTI_INDEX_LIMIT_COMPOSITE_KEY_SIZE</code>).
This change should be transparent to users, with the exception that
<code>composite_key::key_extractors</code> returns a <code>std::tuple</code>
instead of a <code>boost::tuple</code> (and similarly for the rest of affected
class templates).
</li>
<li>Removed internal workarounds and fallbacks to support pre-C++11 compilers.
</li>
</ul>
</p>
<h2><a name="boost_1_85">Boost 1.85 release</a></h2>
<p>
<ul>
<li>Fixed documentation errors.</li>
</ul>
</p>
<h2><a name="boost_1_84">Boost 1.84 release</a></h2>
<p>
<ul>
<li>Fixed a serialization-related compile-time bug in old compilers
without ADL support
(<a href="https://github.com/boostorg/multi_index/issues/70">issue #70</a>).
</li>
</ul>
</p>
<h2><a name="boost_1_83">Boost 1.83 release</a></h2>
<p>
<ul>
<li>Updated range <code>insert</code> in non-unique ordered indices to preserve insertion order
of equivalent elements
(<a href="https://github.com/boostorg/multi_index/issues/68">issue #68</a>).
</li>
<li>Serialization now uses <code>std::size_t</code> instead of <code>unsigned long</code>
to save and load the size of a <code>multi_index_container</code>
(<code>unsigned long</code> is smaller than <code>std::size_t</code> in LLP64 data models).
<code>multi_index_container</code> serialization
<a href="../../serialization/doc/tutorial.html#versioning">class version</a> has been
bumped from 3 to 4 to reflect this change.
</li>
</ul>
</p>
<h2><a name="boost_1_82">Boost 1.82 release</a></h2>
<p>
<ul>
<li>Serialization now uses <code>unsigned long</code> instead of
<a href="../../serialization/doc/wrappers.html#collection_size_type"><code>collection_size_type</code></a>,
and <code>multi_index_container</code> serialization
<a href="../../serialization/doc/tutorial.html#versioning">class version</a> has been
bumped from 2 to 3 to reflect this change.
Reading old archives may fail for custom archive types giving special treatment to
<code>collection_size_type</code> values: if this is the case, globally define
the macro <code>BOOST_MULTI_INDEX_ENABLE_SERIALIZATION_COMPATIBILITY_V2</code>
to ensure backwards compatibility in reading operations.
</li>
<li>Maintenance work.</li>
</ul>
</p>
<h2><a name="boost_1_81">Boost 1.81 release</a></h2>
<p>
<ul>
<li>Maintenance work.</li>
</ul>
</p>
<h2><a name="boost_1_80">Boost 1.80 release</a></h2>
<p>
@@ -523,7 +405,7 @@ Acknowledgements
</li>
<li>Random access indices provide <code>shrink_to_fit()</code>.</li>
</ul>
Refer to the compiler specifics section for limitations
Refer to the <a href="compiler_specifics.html">compiler specifics</a> section for limitations
on pre-C++11 compilers.
</li>
<li>The following classes are deprecated:
@@ -842,7 +724,8 @@ Acknowledgements
Boost 1.32 release. This results in much shorter and more readable error
messages and has also a beneficial impact on compilers with strict limits on
symbol name lengths. Additionally, a section on further
reduction of symbol name lengths has been added.
<a href="compiler_specifics.html#symbol_reduction">reduction of symbol name
lengths</a> has been added.
</li>
<li>Restructured some parts of the documentation, new examples.</li>
<li>Maintenance fixes.</li>
@@ -863,9 +746,9 @@ Acknowledgements
<br>
<p>Revised June 27th 2026</p>
<p>Revised April 8th 2022</p>
<p>&copy; Copyright 2003-2026 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
<p>&copy; Copyright 2003-2022 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">
+5 -5
View File
@@ -55,7 +55,7 @@ with some of the least common features offered by Boost.MultiIndex.
<tr>
<td><a href="../test/test_capacity.cpp"><code>test_capacity.cpp</code></a></td>
<td><code>empty</code>, <code>size</code>, <code>resize</code>
(non-key-based indices) and <code>reserve</code>/<code>capacity</code>
(non key-based indices) and <code>reserve</code>/<code>capacity</code>
(random access indices only).</td>
</tr>
<tr class="odd_tr">
@@ -73,7 +73,7 @@ with some of the least common features offered by Boost.MultiIndex.
<tr>
<td><a href="../test/test_copy_assignment.cpp"><code>test_copy_assignment.cpp</code></a></td>
<td>Various forms of assignment: copy, <code>operator =</code>, insertion,
(non key-based indices only) <code>assign</code>.
(non key-based indices only) <code>assign</code> .
</tr>
<tr class="odd_tr">
<td><a href="../test/test_hash_ops.cpp"><code>test_hash_ops.cpp</code></a></td>
@@ -101,7 +101,7 @@ with some of the least common features offered by Boost.MultiIndex.
</tr>
<tr class="odd_tr">
<td><a href="../test/test_mpl_ops.cpp"><code>test_mpl_ops.cpp</code></a></td>
<td>Boost.MPL interoperability (when <code> BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT</code> is enabled).</td>
<td>Metaprogramming manipulations of <code>multi_index_container</code> types.</td>
</tr>
<tr>
<td><a href="../test/test_node_handling.cpp"><code>test_node_handling.cpp</code></a></td>
@@ -166,9 +166,9 @@ Future work
<br>
<p>Revised October 26th 2025</p>
<p>Revised May 9th 2020</p>
<p>&copy; Copyright 2003-2025 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">
+8 -8
View File
@@ -114,7 +114,7 @@ construct easily becomes unmaintainable.
<p>
Boost.MultiIndex features <a href="#ord_indices"><i>ordered indices</i></a>, which
sort the elements according to a particular key, and are designed to help programmers
in need of sequences of elements for which <i>more than one</i> sorting criterion is
in need of sequences of elements for which <i>more than one</i> sorting criteria are
relevant. We do so by defining a <code>multi_index_container</code>
instantiation composed of several ordered indices: each index, viewed in isolation,
behaves much as an ordered <code>std::set</code> (or <code>std::multiset</code>), whilst
@@ -268,7 +268,7 @@ does not show any advantage. The code for inserting the text into the container
does not change as sequenced indices provide an interface similar to that of
<code>std::list</code> (no explicit access to this index through
<code>get&lt;0>()</code> is needed as <code>multi_index_container</code> inherits the
functionality of index #0). But the specification of an additional ordered index
functionality of index #0.) But the specification of an additional ordered index
allows us to implement <code>occurrences</code> and <code>delete_word</code>
in a much more efficient manner:
</p>
@@ -417,7 +417,7 @@ for instance,
<li><code>employee_set::nth_index&lt;1>::type</code> is the type of
index #1,</li>
<li><code>employee_set::index&lt;name>::type</code> is the type of the index
tagged with <code>name</code> (the same index #1 in this case).</li>
tagged with <code>name</code> (the same index #1 in this case.)</li>
</ul>
<code>get()</code>, on the other hand, is overloaded to serve both styles of access:
</p>
@@ -453,7 +453,7 @@ in the previous example can be rewritten to hold two different tags
<p>
Each index of a <code>multi_index_container</code> uses its own
iterator types, which are different from those of other indices. As is
iterator types, which are different from those of another indices. As is
the rule with STL containers, these iterators are defined as nested
types of the index:
</p>
@@ -496,7 +496,7 @@ Currently, Boost.MultiIndex provides the following index types:
<li>Ordered indices sort the elements like <code>std::set</code>s do and
provide a similar interface. There are <i>unique</i> and <i>non-unique</i>
variants: the former do not allow for duplicates, while the latter permit
them (like <code>std::multiset</code>).</li>
them (like <code>std::multiset</code>.)</li>
<li>Ranked indices are a variation of ordered indices providing extra capabilities
for querying and accessing elements based on their <i>rank</i> (the numerical position
they occupy in the index).
@@ -766,7 +766,7 @@ Here we are not only passing IDs instead of <code>employee</code> objects:
an alternative comparison predicate is passed as well. In general, lookup operations
of ordered indices are overloaded to accept
<a href="../reference/ord_indices.html#set_operations"><i>compatible sorting
criteria</i></a>. The somewhat cumbersome definition of compatibility in this context
criteria</i></a>. The somewhat cumbersone definition of compatibility in this context
is given in the reference, but roughly speaking we say that a comparison predicate
<code>C1</code> is compatible with <code>C2</code> if any sequence sorted by
<code>C2</code> is also sorted with respect to <code>C1</code>.
@@ -801,7 +801,7 @@ The following shows a more interesting use of compatible predicates:
Range searching, i.e. the lookup of all elements in a given interval, is a very
frequent operation for which standard <code>lower_bound</code> and
<code>upper_bound</code> can be resorted to, though in a cumbersome manner.
For instance, the following code retrieves the elements of a
For instance, the following code retrieves the elements of an
<code>multi_index_container&lt;double></code> in the interval [100,200]:
</p>
@@ -1229,7 +1229,7 @@ Appropriate instantiations of <code>multi_index_container</code> can in fact sim
<code>std::set</code>, <code>std::multiset</code> and (with more limitations)
<code>std::list</code>, as shown in the
<a href="techniques.html#emulate_std_containers">techniques</a>
section. These simulations are nearly as efficient as the original STL
section. These simulations are as nearly as efficient as the original STL
containers; consult the <a href="../reference/index.html">reference</a> for further
information on complexity guarantees and the
<a href="../performance.html">performance section</a> for practical measurements of
+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">
+3 -24
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>
@@ -163,7 +162,7 @@ asserting:
</pre></blockquote>
<p>
Other possibilities, like outputting to a log or firing some kind of alert, are
Other possibilites, like outputting to a log or firing some kind of alert, are
also implementable.
</p>
@@ -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">
+1 -1
View File
@@ -101,7 +101,7 @@ indices are met.
<p>
All the public types of Boost.MultiIndex reside in namespace <code>::boost::multi_index</code>.
Additionally, the main class template <code>multi_index_container</code> and global functions
Additionaly, the main class template <code>multi_index_container</code> and global functions
<code>get</code> and <code>project</code> are lifted to namespace <code>::boost</code>
by means of <code>using</code> declarations. For brevity of exposition, the fragments
of code in the documentation are written as if the following declarations were in effect:
+1 -1
View File
@@ -757,7 +757,7 @@ specifically designed for handling the elements of a container,
and not only benefit from the iterator orientation of container interfaces,
but are also capable of exposing many more programming bugs than raw pointers, both
at compile and run time. <code>iterator_to</code> is thus meant to be used
in scenarios where access via iterators is not suitable or desirable:
in scenarios where access via iterators is not suitable or desireable:
<ul>
<li>Interoperability with preexisting APIs based on pointers or references.</li>
<li>Publication of pointer-based interfaces (for instance, when
+3 -3
View File
@@ -494,7 +494,7 @@ The analogous concept in Boost.MultiIndex is modeled by means of
</pre></blockquote>
<p>
<code>composite_key</code> accepts several key extractors on the same
<code>composite_key</code> accepts two or more key extractors on the same
value (here, <code>phonebook_entry</code>). Lookup operations on a composite
key are accomplished by passing tuples with the values searched:
</p>
@@ -1126,9 +1126,9 @@ Container creation
<br>
<p>Revised November 1st 2025</p>
<p>Revised April 19th 2020</p>
<p>&copy; Copyright 2003-2025 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">
+38 -42
View File
@@ -40,8 +40,8 @@ Boost.MultiIndex reference
</li>
<li><a href="#metaprogrammming">Metaprogramming and <code>multi_index_container</code></a>
<ul>
<li><a href="#analysis">Analysis</a></li>
<li><a href="#synthesis">Synthesis</a></li>
<li><a href="#mpl_analysis">MPL analysis</a></li>
<li><a href="#mpl_synthesis">MPL synthesis</a></li>
</ul>
</li>
</ul>
@@ -53,7 +53,7 @@ Boost.MultiIndex reference
containers</a></h3>
<p>
Academic motivations aside, there is a practical interest in emulating standard
Academic movitations aside, there is a practical interest in emulating standard
associative containers by means of <code>multi_index_container</code>, namely to take
advantage of extended functionalities provided by <code>multi_index_container</code> for
lookup, range querying and updating.
@@ -266,10 +266,11 @@ or, if the default value <code>Allocator=std::allocator&lt;T></code> is used:
<p>
Boost.MultiIndex provides a number of facilities intended to allow the analysis and
synthesis of <code>multi_index_container</code> instantiations with metaprogramming.
synthesis of <code>multi_index_container</code> instantiations by
<a href="../../../../libs/mpl/doc/index.html">MPL</a> metaprograms.
</p>
<h3><a name="analysis">Analysis</a></h3>
<h3><a name="mpl_analysis">MPL analysis</a></h3>
<p>
Given a <code>multi_index_container</code> instantiation, the following nested types are
@@ -281,47 +282,39 @@ definition of the <code>multi_index_container</code>:
<li><code>iterator_type_list</code>,</li>
<li><code>const_iterator_type_list</code>.</li>
</ul>
Each of these types is an
<a href="../../../../libs/mp11/doc/html/mp11.html#definitions">Mp11 list</a>
with as many elements as indices
Each of these types is an MPL sequence with as many elements as indices
comprise the <code>multi_index_container</code>: for instance, the <code>n</code>-th
element of <code>iterator_type_list</code> is the same as
<code>nth_index&lt;n>::type::iterator</code>. Boost.Mp11 makes it very easy
to inspect and manipulate these lists:
<code>nth_index&lt;n>::type::iterator</code>.
</p>
<p>
A subtle but important distinction exists between
<code>index_specifier_type_list</code> and <code>index_type_list</code>:
the former typelist holds the index <i>specifiers</i>
with which the <code>multi_index_container</code> instantiation was defined,
while the latter gives access to the actual implementation classes
corresponding to each specifier. An example will help to clarify
this distinction. Given the instantiation:
</p>
<blockquote><pre>
<span class=keyword>using</span> <span class=identifier>indexed_t</span><span class=special>=</span><span class=identifier>multi_index_container</span><span class=special>&lt;</span>
<span class=keyword>typedef</span> <span class=identifier>multi_index_container</span><span class=special>&lt;</span>
<span class=keyword>int</span><span class=special>,</span>
<span class=identifier>indexed_by</span><span class=special>&lt;</span>
<span class=identifier>ordered_unique</span><span class=special>&lt;</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=keyword>int</span><span class=special>&gt;</span> <span class=special>&gt;,</span>
<span class=identifier>sequenced</span><span class=special>&lt;&gt;</span>
<span class=special>&gt;</span>
<span class=special>&gt;;</span>
<span class=identifier>boost</span><span class=special>::</span><span class=identifier>mp11</span><span class=special>::</span><span class=identifier>mp_for_each</span><span class=special>&lt;</span><span class=identifier>indexed_t</span><span class=special>::</span><span class=identifier>index_specifier_type_list</span><span class=special>&gt;([](</span><span class=keyword>auto</span> <span class=identifier>I</span><span class=special>){</span>
<span class=identifier>std</span><span class=special>::</span><span class=identifier>cout</span> <span class=special>&lt;&lt;</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>typeindex</span><span class=special>::</span><span class=identifier>type_id</span><span class=special>&lt;</span><span class=identifier>decltype</span><span class=special>(</span><span class=identifier>I</span><span class=special>)&gt;().</span><span class=identifier>pretty_name</span><span class=special>()</span> <span class=special>&lt;&lt;</span> <span class=string>&quot;\n&quot;</span><span class=special>;</span>
<span class=special>});</span>
<span class=comment>// Output:
//
// struct boost::multi_index::ordered_unique&lt;struct boost::multi_index::identity&lt;int&gt;,void,void&gt;
// struct boost::multi_index::sequenced&lt;struct boost::multi_index::tag&lt;&gt; &gt;</span>
<span class=special>&gt;</span> <span class=identifier>indexed_t</span><span class=special>;</span>
</pre></blockquote>
<p>
A subtle but important distinction exists between
<code>index_specifier_type_list</code> and <code>index_type_list</code>:
the former list holds the index <i>specifiers</i>
with which the <code>multi_index_container</code> instantiation was defined,
while the latter gives access to the actual implementation classes
corresponding to each specifier. In the example above,
<code>indexed_t::index_specifier_type_list</code> is a type list with
elements
</p>
<blockquote><pre>
<span class=identifier>ordered_unique</span><span class=special>&lt;</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=keyword>int</span><span class=special>&gt;</span><span class=special>&gt;</span>
<span class=identifier>ordered_unique</span><span class=special>&lt;</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=keyword>int</span><span class=special>&gt;</span> <span class=special>&gt;</span>
<span class=identifier>sequenced</span><span class=special>&lt;&gt;</span>
</pre></blockquote>
@@ -335,18 +328,21 @@ while <code>indexed_t::index_type_list</code> holds the types
</pre></blockquote>
<p>
so the lists are radically different.
so the typelists are radically different. Check the
<a href="../reference/multi_index_container.html#types">reference</a>
for the exact MPL sequence concepts modeled by these type lists.
</p>
<h3><a name="synthesis">Synthesis</a></h3>
<h3><a name="mpl_synthesis">MPL synthesis</a></h3>
<p>
Although typically indices are specified by means of the
<code>indexed_by</code> construct, actually any Mp11 list can be provided instead:
<code>indexed_by</code> construct, actually any MPL sequence of
index specifiers can be provided instead:
</p>
<blockquote><pre>
<span class=keyword>using</span> <span class=identifier>index_list_t</span><span class=special>=</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>tuple</span><span class=special>&lt;</span><span class=identifier>ordered_unique</span><span class=special>&lt;</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=keyword>int</span><span class=special>&gt;</span> <span class=special>&gt;,</span><span class=identifier>sequenced</span><span class=special>&lt;&gt;&gt;</span> <span class=special>;</span>
<span class=keyword>typedef</span> <span class=identifier>mpl</span><span class=special>::</span><span class=identifier>vector</span><span class=special>&lt;</span><span class=identifier>ordered_unique</span><span class=special>&lt;</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=keyword>int</span><span class=special>&gt;</span> <span class=special>&gt;,</span><span class=identifier>sequenced</span><span class=special>&lt;&gt;</span> <span class=special>&gt;</span> <span class=identifier>index_list_t</span><span class=special>;</span>
<span class=keyword>typedef</span> <span class=identifier>multi_index_container</span><span class=special>&lt;</span>
<span class=keyword>int</span><span class=special>,</span>
@@ -356,30 +352,30 @@ Although typically indices are specified by means of the
<p>
This possibility enables the synthesis of instantiations of
<code>multi_index_container</code> through metaprogramming, as the following
<code>multi_index_container</code> through MPL metaprograms, as the following
example shows:
</p>
<blockquote><pre>
<span class=comment>// original multi_index_container instantiation</span>
<span class=keyword>using</span> <span class=identifier>indexed_t1</span><span class=special>=</span><span class=identifier>multi_index_container</span><span class=special>&lt;</span>
<span class=keyword>typedef</span> <span class=identifier>multi_index_container</span><span class=special>&lt;</span>
<span class=keyword>int</span><span class=special>,</span>
<span class=identifier>indexed_by</span><span class=special>&lt;</span>
<span class=identifier>ordered_unique</span><span class=special>&lt;</span><span class=identifier>identity</span><span class=special>&lt;</span><span class=keyword>int</span><span class=special>&gt;</span> <span class=special>&gt;</span>
<span class=special>&gt;</span>
<span class=special>&gt;;</span>
<span class=special>&gt;</span> <span class=identifier>indexed_t1</span><span class=special>;</span>
<span class=comment>// we take its index list and add an index</span>
<span class=keyword>using</span> <span class=identifier>index_list_t2</span><span class=special>=</span><span class=identifier>boost</span><span class=special>::</span><span class=identifier>mp11</span><span class=special>::</span><span class=identifier>mp_push_front</span><span class=special>&lt;</span>
<span class=keyword>typedef</span> <span class=identifier>boost</span><span class=special>::</span><span class=identifier>mpl</span><span class=special>::</span><span class=identifier>push_front</span><span class=special>&lt;</span>
<span class=identifier>indexed_t1</span><span class=special>::</span><span class=identifier>index_specifier_type_list</span><span class=special>,</span>
<span class=identifier>sequenced</span><span class=special>&lt;&gt;</span>
<span class=special>&gt;;</span>
<span class=special>&gt;::</span><span class=identifier>type</span> <span class=identifier>index_list_t</span><span class=special>;</span>
<span class=comment>// augmented multi_index_container</span>
<span class=keyword>using</span> <span class=identifier>indexed_t2</span><span class=special>=</span><span class=identifier>multi_index_container</span><span class=special>&lt;</span>
<span class=keyword>typedef</span> <span class=identifier>multi_index_container</span><span class=special>&lt;</span>
<span class=keyword>int</span><span class=special>,</span>
<span class=identifier>index_list_t2</span>
<span class=special>&gt;;</span>
<span class=identifier>index_list_t</span>
<span class=special>&gt;</span> <span class=identifier>indexed_t2</span><span class=special>;</span>
</pre></blockquote>
<hr>
@@ -396,9 +392,9 @@ Boost.MultiIndex reference
<br>
<p>Revised October 25th 2025</p>
<p>Revised November 7th 2008</p>
<p>&copy; Copyright 2003-2025 Joaqu&iacute;n M L&oacute;pez Mu&ntilde;oz.
<p>&copy; Copyright 2003-2008 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">
+13 -10
View File
@@ -1,66 +1,69 @@
# Boost.MultiIndex examples Jamfile
#
# Copyright 2003-2007 Joaqun M Lpez Muoz.
# 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)
#
# See http://www.boost.org/libs/multi_index for library home page.
project : requirements <library>/boost/multi_index//boost_multi_index ;
exe basic
: basic.cpp
: <include>$(BOOST_ROOT)
;
exe bimap
: bimap.cpp
: <include>$(BOOST_ROOT)
;
exe complex_structs
: complex_structs.cpp
: <include>$(BOOST_ROOT)
;
exe composite_keys
: composite_keys.cpp
/boost/tokenizer//boost_tokenizer
: <include>$(BOOST_ROOT)
;
exe fun_key
: fun_key.cpp
: <include>$(BOOST_ROOT)
;
exe hashed
: hashed.cpp
/boost/tokenizer//boost_tokenizer
: <include>$(BOOST_ROOT)
;
exe ip_allocator
: ip_allocator.cpp
/boost/interprocess//boost_interprocess
: <threading>multi
: <include>$(BOOST_ROOT) <threading>multi
;
exe non_default_ctor
: non_default_ctor.cpp
: <include>$(BOOST_ROOT)
;
exe random_access
: random_access.cpp
/boost/tokenizer//boost_tokenizer
: <include>$(BOOST_ROOT)
;
exe rearrange
: rearrange.cpp
/boost/random//boost_random
: <include>$(BOOST_ROOT)
;
exe sequenced
: sequenced.cpp
/boost/tokenizer//boost_tokenizer
: <include>$(BOOST_ROOT)
;
exe serialization
: serialization.cpp
/boost/serialization//boost_serialization
: <include>$(BOOST_ROOT)
;
+8 -4
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex basic example.
*
* Copyright 2003-2025 Joaquin M Lopez Munoz.
* Copyright 2003-2022 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -47,6 +47,10 @@ struct id{};
struct name{};
struct age{};
/* see Compiler specifics: Use of member_offset for info on
* BOOST_MULTI_INDEX_MEMBER
*/
/* Define a multi_index_container of employees with following indices:
* - a unique index sorted by employee::id,
* - a non-unique index sorted by employee::name,
@@ -57,11 +61,11 @@ typedef multi_index_container<
employee,
indexed_by<
ordered_unique<
tag<id>, member<employee,int,&employee::id> >,
tag<id>, BOOST_MULTI_INDEX_MEMBER(employee,int,id)>,
ordered_non_unique<
tag<name>,member<employee,std::string,&employee::name> >,
tag<name>,BOOST_MULTI_INDEX_MEMBER(employee,std::string,name)>,
ordered_non_unique<
tag<age>, member<employee,int,&employee::age> > >
tag<age>, BOOST_MULTI_INDEX_MEMBER(employee,int,age)> >
> employee_set;
template<typename Tag,typename MultiIndexContainer>
+45 -1
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of a bidirectional map.
*
* Copyright 2003-2025 Joaquin M Lopez Munoz.
* Copyright 2003-2009 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -44,6 +44,30 @@ struct bidirectional_map
ToType second;
};
#if defined(BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS) ||\
defined(BOOST_MSVC)&&(BOOST_MSVC<1300) ||\
defined(BOOST_INTEL_CXX_VERSION)&&defined(_MSC_VER)&&\
(BOOST_INTEL_CXX_VERSION<=700)
/* see Compiler specifics: Use of member_offset for info on member<> and
* member_offset<>
*/
BOOST_STATIC_CONSTANT(unsigned,from_offset=offsetof(value_type,first));
BOOST_STATIC_CONSTANT(unsigned,to_offset =offsetof(value_type,second));
typedef multi_index_container<
value_type,
indexed_by<
ordered_unique<
tag<from>,member_offset<value_type,FromType,from_offset> >,
ordered_unique<
tag<to>, member_offset<value_type,ToType,to_offset> >
>
> type;
#else
/* A bidirectional map can be simulated as a multi_index_container
* of pairs of (FromType,ToType) with two unique indices, one
* for each member of the pair.
@@ -58,6 +82,8 @@ struct bidirectional_map
tag<to>, member<value_type,ToType,&value_type::second> >
>
> type;
#endif
};
/* a dictionary is a bidirectional map from strings to strings */
@@ -82,6 +108,22 @@ int main()
std::string word;
std::getline(std::cin,word);
#if defined(BOOST_NO_MEMBER_TEMPLATES) /* use global get<> and family instead */
dictionary::iterator it=get<from>(d).find(word);
if(it!=d.end()){
std::cout<<word<<" is said "<<it->second<<" in English"<<std::endl;
}
else{
nth_index<dictionary,1>::type::iterator it2=get<1>(d).find(word);
if(it2!=get<1>(d).end()){
std::cout<<word<<" is said "<<it2->first<<" in Spanish"<<std::endl;
}
else std::cout<<"No such word in the dictionary"<<std::endl;
}
#else
/* search the queried word on the from index (Spanish) */
dictionary::iterator it=d.get<from>().find(word);
@@ -101,5 +143,7 @@ int main()
else std::cout<<"No such word in the dictionary"<<std::endl;
}
#endif
return 0;
}
+16 -12
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example: complex searches and foreign keys.
*
* Copyright 2003-2025 Joaquin M Lopez Munoz.
* Copyright 2003-2008 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)
@@ -88,6 +88,10 @@ struct car_model
}
};
/* see Compiler specifics: Use of member_offset for info on
* BOOST_MULTI_INDEX_MEMBER
*/
/* Car manufacturers are stored in a multi_index_container with one single
* index on the name member. This is functionally equivalent to an std::set,
* though in this latter case we woud have to define a non-default comparison
@@ -98,7 +102,7 @@ typedef multi_index_container<
car_manufacturer,
indexed_by<
ordered_unique<
member<car_manufacturer,std::string,&car_manufacturer::name>
BOOST_MULTI_INDEX_MEMBER(car_manufacturer,std::string,name)
>
>
> car_manufacturer_table;
@@ -114,18 +118,18 @@ typedef multi_index_container<
car_model,
indexed_by<
ordered_unique<
tag<model>,member<car_model,std::string,&car_model::model>
tag<model>,BOOST_MULTI_INDEX_MEMBER(car_model,std::string,model)
>,
ordered_non_unique<
tag<manufacturer>,
key_from_key<
member<car_manufacturer,const std::string,&car_manufacturer::name>,
member<
car_model,const car_manufacturer *,&car_model::manufacturer>
BOOST_MULTI_INDEX_MEMBER(car_manufacturer,const std::string,name),
BOOST_MULTI_INDEX_MEMBER(
car_model,const car_manufacturer *,manufacturer)
>
>,
ordered_non_unique<
tag<price>,member<car_model,int,&car_model::price>
tag<price>,BOOST_MULTI_INDEX_MEMBER(car_model,int,price)
>
>
> car_table;
@@ -134,7 +138,7 @@ typedef multi_index_container<
* actual objects. These views are used in the complex search performed
* in the program. Resorting to multi_index of pointers eliminates
* unnecessary copying of objects, and provides us with an opportunity
* to show how boost::multi_index::member can be used with pointer
* to show how BOOST_MULTI_INDEX_MEMBER can be used with pointer
* type elements.
* car_table_price_view indexes (pointers to) car_models by price.
*/
@@ -142,7 +146,7 @@ typedef multi_index_container<
typedef multi_index_container<
const car_model*,
indexed_by<
ordered_non_unique<member<car_model,const int,&car_model::price> >
ordered_non_unique<BOOST_MULTI_INDEX_MEMBER(car_model,const int,price)>
>
> car_table_price_view;
@@ -155,9 +159,9 @@ typedef multi_index_container<
indexed_by<
ordered_non_unique<
key_from_key<
member<car_manufacturer,const std::string,&car_manufacturer::name>,
member<
car_model,const car_manufacturer * const,&car_model::manufacturer>
BOOST_MULTI_INDEX_MEMBER(car_manufacturer,const std::string,name),
BOOST_MULTI_INDEX_MEMBER(
car_model,const car_manufacturer * const,manufacturer)
>
>
>
+11 -7
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of composite keys.
*
* Copyright 2003-2025 Joaquin M Lopez Munoz.
* Copyright 2003-2008 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -57,22 +57,26 @@ struct file_entry
* file and size. These indices are firstly ordered by directory, as commands
* work on a current directory basis. Composite keys are just fine to model
* this.
* NB: The use of derivation here instead of simple typedef helps produce
* shorter symbol names in compilation
* NB: The use of derivation here instead of simple typedef is explained in
* Compiler specifics: type hiding.
*/
struct name_key:composite_key<
file_entry,
member<file_entry,const file_entry*,&file_entry::dir>,
member<file_entry,std::string,&file_entry::name>
BOOST_MULTI_INDEX_MEMBER(file_entry,const file_entry*,dir),
BOOST_MULTI_INDEX_MEMBER(file_entry,std::string,name)
>{};
struct size_key:composite_key<
file_entry,
member<file_entry,const file_entry* const,&file_entry::dir>,
member<file_entry,unsigned,&file_entry::size>
BOOST_MULTI_INDEX_MEMBER(file_entry,const file_entry* const,dir),
BOOST_MULTI_INDEX_MEMBER(file_entry,unsigned,size)
>{};
/* see Compiler specifics: composite_key in compilers without partial
* template specialization, for info on composite_key_result_less
*/
typedef multi_index_container<
file_entry,
indexed_by<
+4 -2
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of functions used as key extractors.
*
* Copyright 2003-2025 Joaquin M Lopez Munoz.
* Copyright 2003-2008 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -54,13 +54,15 @@ std::string::size_type name_record_length(const name_record& r)
/* multi_index_container with indices based on name_record::name()
* and name_record_length().
* See Compiler specifics: Use of const_mem_fun_explicit and
* mem_fun_explicit for info on BOOST_MULTI_INDEX_CONST_MEM_FUN.
*/
typedef multi_index_container<
name_record,
indexed_by<
ordered_unique<
const_mem_fun<name_record,std::string,&name_record::name>
BOOST_MULTI_INDEX_CONST_MEM_FUN(name_record,std::string,name)
>,
ordered_non_unique<
global_fun<const name_record&,std::string::size_type,name_record_length>
+19 -15
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of use of hashed indices.
*
* Copyright 2003-2025 Joaquin M Lopez Munoz.
* Copyright 2003-2008 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -37,15 +37,19 @@ struct word_counter_entry
word_counter_entry(std::string word_):word(word_),occurrences(0){}
};
/* see Compiler specifics: Use of member_offset for info on
* BOOST_MULTI_INDEX_MEMBER
*/
typedef multi_index_container<
word_counter_entry,
indexed_by<
ordered_non_unique<
member<word_counter_entry,unsigned int,&word_counter_entry::occurrences>,
BOOST_MULTI_INDEX_MEMBER(word_counter_entry,unsigned int,occurrences),
std::greater<unsigned int> /* sorted beginning with most frequent */
>,
hashed_unique<
member<word_counter_entry,std::string,&word_counter_entry::word>
BOOST_MULTI_INDEX_MEMBER(word_counter_entry,std::string,word)
>
>
> word_counter;
@@ -66,23 +70,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 */
+9 -4
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of use of Boost.Interprocess allocators.
*
* Copyright 2003-2026 Joaquin M Lopez Munoz.
* Copyright 2003-2008 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 */
@@ -103,18 +104,22 @@ struct partial_str_less
* * We are using a Boost.Interprocess specific allocator.
*/
/* see Compiler specifics: Use of member_offset for info on
* BOOST_MULTI_INDEX_MEMBER
*/
typedef multi_index_container<
book,
indexed_by<
ordered_non_unique<
member<book,shared_string,&book::author>
BOOST_MULTI_INDEX_MEMBER(book,shared_string,author)
>,
ordered_non_unique<
member<book,shared_string,&book::name>,
BOOST_MULTI_INDEX_MEMBER(book,shared_string,name),
partial_str_less
>,
ordered_non_unique<
member<book,unsigned,&book::prize>
BOOST_MULTI_INDEX_MEMBER(book,unsigned,prize)
>
>,
bip::allocator<book,bip::managed_mapped_file::segment_manager>
+15 -2
View File
@@ -1,6 +1,6 @@
/* Boost.MultiIndex example of use of rearrange facilities.
*
* Copyright 2003-2025 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)
@@ -22,9 +22,12 @@
#include <algorithm>
#include <iostream>
#include <iterator>
#include <random>
#include <vector>
#if !defined(BOOST_NO_CXX11_HDR_RANDOM)
#include <random>
#endif
using boost::multi_index_container;
using namespace boost::multi_index;
@@ -194,12 +197,22 @@ struct random_shuffler
private:
deck_view dv;
#if !defined(BOOST_NO_CXX11_HDR_RANDOM)
std::mt19937 e;
void shuffle_view()
{
std::shuffle(dv.begin(),dv.end(),e);
}
#else
/* for pre-C++11 compilers we use std::random_shuffle */
void shuffle_view()
{
std::random_shuffle(dv.begin(),dv.end());
}
#endif
};
/* Repeat a given shuffling algorithm repeats_num times
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,54 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_ACCESS_SPECIFIER_HPP
#define BOOST_MULTI_INDEX_DETAIL_ACCESS_SPECIFIER_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
/* In those compilers that do not accept the member template friend syntax,
* some protected and private sections might need to be specified as
* public.
*/
#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
#define BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS public
#define BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS public
#else
#define BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS protected
#define BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS private
#endif
/* GCC does not correctly support in-class using declarations for template
* functions. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9810
* MSVC 7.1/8.0 seem to have a similar problem, though the conditions in
* which the error happens are not that simple. I have yet to isolate this
* into a snippet suitable for bug reporting.
* Sun Studio also has this problem, which might be related, from the
* information gathered at Sun forums, with a known issue notified at the
* internal bug report 6421933. The bug is present up to Studio Express 2,
* the latest preview version of the future Sun Studio 12. As of this writing
* (October 2006) it is not known whether a fix will finally make it into the
* official Sun Studio 12.
*/
#if BOOST_WORKAROUND(__GNUC__,==3)&&(__GNUC_MINOR__<4)||\
BOOST_WORKAROUND(BOOST_MSVC,==1310)||\
BOOST_WORKAROUND(BOOST_MSVC,==1400)||\
BOOST_WORKAROUND(__SUNPRO_CC,BOOST_TESTED_AT(0x590))
#define BOOST_MULTI_INDEX_PRIVATE_IF_USING_DECL_FOR_TEMPL_FUNCTIONS public
#else
#define BOOST_MULTI_INDEX_PRIVATE_IF_USING_DECL_FOR_TEMPL_FUNCTIONS private
#endif
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -25,8 +25,14 @@ namespace detail{
template<typename T>
void adl_swap(T& x,T& y)
{
#if !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
using std::swap;
swap(x,y);
#else
std::swap(x,y);
#endif
}
} /* namespace multi_index::detail */
@@ -0,0 +1,173 @@
/* Copyright 2003-2020 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_ALLOCATOR_TRAITS_HPP
#define BOOST_MULTI_INDEX_DETAIL_ALLOCATOR_TRAITS_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
#include <boost/type_traits/is_empty.hpp>
#include <memory>
#else
#include <boost/detail/workaround.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/multi_index/detail/vartempl_support.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_empty.hpp>
#include <new>
#endif
namespace boost{
namespace multi_index{
namespace detail{
/* poor man's replacement of std::allocator_traits */
#if !defined(BOOST_NO_CXX11_ALLOCATOR)
template<typename T> struct void_helper{typedef void type;};
template<typename Allocator,typename=void>
struct allocator_is_always_equal:boost::is_empty<Allocator>{};
template<typename Allocator>
struct allocator_is_always_equal<
Allocator,
typename void_helper<
typename std::allocator_traits<Allocator>::is_always_equal
>::type
>:std::allocator_traits<Allocator>::is_always_equal{};
template<typename Allocator>
struct allocator_traits:std::allocator_traits<Allocator>
{
/* wrap std::allocator_traits alias templates for use in C++03 codebase */
typedef std::allocator_traits<Allocator> super;
/* pre-C++17 compatibilty */
typedef allocator_is_always_equal<Allocator> is_always_equal;
template<typename T>
struct rebind_alloc
{
typedef typename super::template rebind_alloc<T> type;
};
template<typename T>
struct rebind_traits
{
typedef typename super::template rebind_traits<T> type;
};
};
#else
/* not a full std::allocator_traits rewrite (not needed) */
template<typename Allocator>
struct allocator_traits
{
typedef Allocator allocator_type;
typedef typename Allocator::value_type value_type;
typedef typename Allocator::pointer pointer;
typedef typename Allocator::const_pointer const_pointer;
/* [const_]void_pointer not provided as boost::pointer_traits's
* rebind_to has been seen to fail with things like
* boost::interprocess::offset_ptr in relatively old environments.
*/
typedef typename Allocator::difference_type difference_type;
typedef typename Allocator::size_type size_type;
typedef boost::false_type propagate_on_container_copy_assignment;
typedef boost::false_type propagate_on_container_move_assignment;
typedef boost::false_type propagate_on_container_swap;
typedef boost::is_empty<Allocator> is_always_equal;
template<typename T>
struct rebind_alloc
{
typedef typename Allocator::template rebind<T>::other type;
};
template<typename T>
struct rebind_traits
{
typedef allocator_traits<typename rebind_alloc<T>::type> type;
};
static pointer allocate(Allocator& a,size_type n){return a.allocate(n);}
static pointer allocate(Allocator& a,size_type n,const_pointer p)
/* should've been const_void_pointer p */
{return a.allocate(n,p);}
static void deallocate(Allocator& a,pointer p,size_type n)
{a.deallocate(p,n);}
template<typename T>
static void construct(Allocator&,T* p,const T& x)
{::new (static_cast<void*>(p)) T(x);}
template<typename T>
static void construct(Allocator&,T* p,BOOST_RV_REF(T) x)
{::new (static_cast<void*>(p)) T(boost::move(x));}
template<typename T,BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK>
static void construct(Allocator&,T* p,BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
{
vartempl_placement_new(p,BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
/* MSVC issues spurious warnings about unreferencend formal parameters in
* destroy<T> when T is a class with trivial dtor.
*/
#pragma warning(push)
#pragma warning(disable:4100)
#endif
template<typename T>
static void destroy(Allocator&,T* p){p->~T();}
#if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1500))
#pragma warning(pop)
#endif
static size_type max_size(Allocator& a)BOOST_NOEXCEPT{return a.max_size();}
static Allocator select_on_container_copy_construction(const Allocator& a)
{
return a;
}
};
#endif
template<typename Allocator,typename T>
struct rebind_alloc_for
{
typedef typename allocator_traits<Allocator>::
template rebind_alloc<T>::type type;
};
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2023 Joaquin M Lopez Munoz.
/* Copyright 2003-2022 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/no_exceptions_support.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/core/serialization.hpp>
#include <boost/serialization/serialization.hpp>
#include <boost/type_traits/aligned_storage.hpp>
#include <boost/type_traits/alignment_of.hpp>
@@ -34,7 +34,7 @@ struct archive_constructed:private noncopyable
template<class Archive>
archive_constructed(Archive& ar,const unsigned int version)
{
core::load_construct_data_adl(ar,&get(),version);
serialization::load_construct_data_adl(ar,&get(),version);
BOOST_TRY{
ar>>get();
}
@@ -48,9 +48,9 @@ struct archive_constructed:private noncopyable
template<class Archive>
archive_constructed(const char* name,Archive& ar,const unsigned int version)
{
core::load_construct_data_adl(ar,&get(),version);
serialization::load_construct_data_adl(ar,&get(),version);
BOOST_TRY{
ar>>core::make_nvp(name,get());
ar>>serialization::make_nvp(name,get());
}
BOOST_CATCH(...){
(&get())->~T();
@@ -1,129 +0,0 @@
/* 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)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_AUGMENTED_STDTUPLE_HPP
#define BOOST_MULTI_INDEX_DETAIL_AUGMENTED_STDTUPLE_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/algorithm.hpp>
#include <boost/mp11/function.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/integer_sequence.hpp>
#include <boost/mp11/integral.hpp>
#include <boost/tuple/tuple.hpp>
#include <tuple>
#include <type_traits>
namespace boost{
namespace multi_index{
namespace detail{
/* augmented_stdtuple<Ts...> derives from std::tuple<Ts...> and provides the
* following non-standard constructors:
*
* - augmented_stdtuple(const Ts& = Ts()...) (this signature is not legal C++,
* shown for explanatory purposes).
* - augmented_stdtuple(boost::tuple<Ts...>) if sizeof...(Ts) does not exceed
* the maximum length of a boost::tuple (10 as of this writing).
*/
template<typename T,typename U>
using is_convertible_to_cref=std::is_convertible<T,const U&>;
template<typename FromList,typename ToList,typename=void>
struct are_convertible_to_crefs:mp11::mp_false{};
template<typename FromList,typename ToList>
struct are_convertible_to_crefs<
FromList,ToList,
typename std::enable_if<
(mp11::mp_size<FromList>::value<=mp11::mp_size<ToList>::value)
>::type
>:
mp11::mp_apply<
mp11::mp_and,
mp11::mp_transform<
is_convertible_to_cref,
FromList,
mp11::mp_take_c<ToList,mp11::mp_size<FromList>::value>
>
>
{};
template<typename... Ts>
struct augmented_stdtuple:std::tuple<Ts...>
{
private:
using super=std::tuple<Ts...>;
static constexpr std::size_t N=sizeof...(Ts);
template<typename... Args>
using are_convertible_to_crefs=
typename detail::are_convertible_to_crefs<mp11::mp_list<Args...>,super>;
struct boost_tuple_too_short{};
using boost_tuple_arg=mp11::mp_eval_if_c<
(mp11::mp_size<boost::tuple<>>::value < N),
boost_tuple_too_short,
boost::tuple,Ts...
>;
struct full_args_ctor{};
augmented_stdtuple(full_args_ctor,const Ts&... args):super(args...){}
struct partial_args_ctor{};
template<std::size_t... Is,typename... Args>
augmented_stdtuple(
partial_args_ctor,mp11::index_sequence<Is...>,Args&&... args):
augmented_stdtuple(
full_args_ctor{},
std::forward<Args>(args)...,
typename std::tuple_element<sizeof...(Args)+Is,super>::type()...)
{}
struct boost_tuple_ctor{};
template<std::size_t... Is>
augmented_stdtuple(
boost_tuple_ctor,mp11::index_sequence<Is...>,const boost_tuple_arg& x):
super(tuples::get<Is>(x)...)
{}
public:
template<
typename... Args,
typename std::enable_if<
are_convertible_to_crefs<Args&&...>::value
>::type* =nullptr
>
augmented_stdtuple(Args&&... args):
augmented_stdtuple(
partial_args_ctor(),mp11::make_index_sequence<N-sizeof...(Args)>(),
std::forward<Args>(args)...)
{}
augmented_stdtuple(const super& x):super(x){}
augmented_stdtuple(const boost_tuple_arg& x):
augmented_stdtuple(
boost_tuple_ctor(),mp11::make_index_sequence<N>(),x)
{}
};
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2022 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -16,8 +16,8 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/core/noncopyable.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/multi_index/detail/adl_swap.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <memory>
@@ -46,15 +46,18 @@ namespace detail{
template<typename T,typename Allocator=std::allocator<T> >
struct auto_space:private noncopyable
{
typedef allocator_rebind_t<Allocator,T> allocator;
typedef allocator_pointer_t<allocator> pointer;
typedef allocator_size_type_t<allocator> size_type;
typedef typename rebind_alloc_for<
Allocator,T>
::type allocator;
typedef allocator_traits<allocator> alloc_traits;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::size_type size_type;
explicit auto_space(const Allocator& al=Allocator(),size_type n=1):
al_(al),n_(n),data_(n_?allocator_allocate(al_,n_):pointer(0))
al_(al),n_(n),data_(n_?alloc_traits::allocate(al_,n_):pointer(0))
{}
~auto_space(){if(n_)allocator_deallocate(al_,data_,n_);}
~auto_space(){if(n_)alloc_traits::deallocate(al_,data_,n_);}
Allocator get_allocator()const{return al_;}
@@ -65,8 +68,7 @@ struct auto_space:private noncopyable
swap(
x,
boost::integral_constant<
bool,
allocator_propagate_on_container_swap_t<allocator>::value>());
bool,alloc_traits::propagate_on_container_swap::value>());
}
void swap(auto_space& x,boost::true_type /* swap_allocators */)
@@ -1,36 +0,0 @@
/* 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)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_BAD_ARCHIVE_EXCEPTION_HPP
#define BOOST_MULTI_INDEX_DETAIL_BAD_ARCHIVE_EXCEPTION_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <stdexcept>
namespace boost{
namespace multi_index{
namespace detail{
struct bad_archive_exception:std::runtime_error
{
bad_archive_exception():std::runtime_error("Invalid or corrupted archive"){}
};
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif
+29 -20
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,9 +14,10 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/integral.hpp>
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mpl/at.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/size.hpp>
#include <boost/multi_index/detail/index_base.hpp>
#include <boost/multi_index/detail/is_index_list.hpp>
#include <boost/static_assert.hpp>
@@ -27,31 +28,39 @@ namespace multi_index{
namespace detail{
/* Mp11 machinery to construct a linear hierarchy of indices out of
* an index list.
/* MPL machinery to construct a linear hierarchy of indices out of
* a index list.
*/
template<typename N,typename Mp11IndexSpecifierList,typename SuperMeta>
using nth_layer_index=typename mp11::mp_at<Mp11IndexSpecifierList,N>::
template index_class<SuperMeta>::type;
struct index_applier
{
template<typename IndexSpecifierMeta,typename SuperMeta>
struct apply
{
typedef typename IndexSpecifierMeta::type index_specifier;
typedef typename index_specifier::
BOOST_NESTED_TEMPLATE index_class<SuperMeta>::type type;
};
};
template<int N,typename Value,typename IndexSpecifierList,typename Allocator>
struct nth_layer
{
using Mp11IndexSpecifierList=detail::mp11_index_list<IndexSpecifierList>;
using type=mp11::mp_eval_if_c<
N==mp11::mp_size<Mp11IndexSpecifierList>::value,
index_base<Value,IndexSpecifierList,Allocator>,
nth_layer_index,
mp11::mp_int<N>,
Mp11IndexSpecifierList,
nth_layer<N+1,Value,IndexSpecifierList,Allocator>
>;
BOOST_STATIC_CONSTANT(int,length=mpl::size<IndexSpecifierList>::value);
typedef typename mpl::eval_if_c<
N==length,
mpl::identity<index_base<Value,IndexSpecifierList,Allocator> >,
mpl::apply2<
index_applier,
mpl::at_c<IndexSpecifierList,N>,
nth_layer<N+1,Value,IndexSpecifierList,Allocator>
>
>::type type;
};
template<typename Value,typename IndexSpecifierList,typename Allocator>
struct multi_index_base_type:
nth_layer<0,Value,IndexSpecifierList,Allocator>
struct multi_index_base_type:nth_layer<0,Value,IndexSpecifierList,Allocator>
{
BOOST_STATIC_ASSERT(detail::is_index_list<IndexSpecifierList>::value);
};
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 Joaquin M Lopez Munoz.
/* Copyright 2003-2018 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,11 +14,11 @@
#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)
#include <boost/core/serialization.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_member.hpp>
#endif
namespace boost{
@@ -67,27 +67,23 @@ public:
* see explanation in safe_mode_iterator notes in safe_mode.hpp.
*/
template<class Archive>
void serialize(Archive& ar,const unsigned int version)
{
core::split_member(ar,*this,version);
}
BOOST_SERIALIZATION_SPLIT_MEMBER()
typedef typename Node::base_type node_base_type;
template<class Archive>
void save(Archive& ar,const unsigned int)const
{
node_base_type* bnode=get_node();
ar<<core::make_nvp("pointer",bnode);
node_base_type* bnode=node;
ar<<serialization::make_nvp("pointer",bnode);
}
template<class Archive>
void load(Archive& ar,const unsigned int)
{
node_base_type* bnode;
ar>>core::make_nvp("pointer",bnode);
node=typename Node::pointer(static_cast<Node*>(bnode));
ar>>serialization::make_nvp("pointer",bnode);
node=static_cast<Node*>(bnode);
}
#endif
@@ -95,10 +91,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-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2022 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -15,8 +15,8 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/core/allocator_access.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/auto_space.hpp>
#include <boost/multi_index/detail/hash_index_node.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
@@ -27,8 +27,8 @@
#include <limits.h>
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
#include <boost/core/serialization.hpp>
#include <boost/multi_index/detail/bad_archive_exception.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/serialization/access.hpp>
#include <boost/throw_exception.hpp>
#endif
@@ -129,10 +129,10 @@ class bucket_array:bucket_array_base<>
{
typedef bucket_array_base<> super;
typedef hashed_index_base_node_impl<
allocator_rebind_t<
typename rebind_alloc_for<
Allocator,
char
>
>::type
> base_node_impl_type;
public:
@@ -224,19 +224,28 @@ void swap(bucket_array<Allocator>& x,bucket_array<Allocator>& y)
* somehow invalid archive.
*/
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
namespace serialization{
#else
namespace multi_index{
namespace detail{
#endif
template<class Archive,typename Allocator>
inline void load_construct_data(
Archive&,boost::multi_index::detail::bucket_array<Allocator>*,
const unsigned int)
{
throw_exception(boost::multi_index::detail::bad_archive_exception());
throw_exception(
archive::archive_exception(archive::archive_exception::other_exception));
}
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
} /* namespace serialization */
#else
} /* namespace multi_index::detail */
} /* namespace multi_index */
#endif
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2014 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,7 +14,7 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/utility.hpp>
#include <boost/mpl/if.hpp>
#include <boost/tuple/tuple.hpp>
#include <tuple>
@@ -55,11 +55,11 @@ struct cons_stdtuple_ctor_normal
template<typename StdTuple,std::size_t N=0>
struct cons_stdtuple_ctor:
mp11::mp_if_c<
boost::mpl::if_c<
N<std::tuple_size<StdTuple>::value,
cons_stdtuple_ctor_normal<StdTuple,N>,
cons_stdtuple_ctor_terminal
>
>::type
{};
template<typename StdTuple,std::size_t N>
+16 -12
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2022 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -16,13 +16,14 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/core/addressof.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/auto_space.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
#include <functional>
#include <utility>
namespace boost{
@@ -65,18 +66,21 @@ struct copy_map_value_copier
struct copy_map_value_mover
{
template<typename Value>
Value&& operator()(Value& x)const{return std::move(x);}
BOOST_RV_REF(Value) operator()(Value& x)const{return boost::move(x);}
};
template <typename Node,typename Allocator>
class copy_map:private noncopyable
{
typedef allocator_rebind_t<Allocator,Node> allocator_type;
typedef allocator_pointer_t<allocator_type> pointer;
typedef typename rebind_alloc_for<
Allocator,Node
>::type allocator_type;
typedef allocator_traits<allocator_type> alloc_traits;
typedef typename alloc_traits::pointer pointer;
public:
typedef const copy_map_entry<Node>* const_iterator;
typedef allocator_size_type_t<allocator_type> size_type;
typedef const copy_map_entry<Node>* const_iterator;
typedef typename alloc_traits::size_type size_type;
copy_map(
const Allocator& al,size_type size,Node* header_org,Node* header_cpy):
@@ -88,7 +92,7 @@ public:
{
if(!released){
for(size_type i=0;i<n;++i){
allocator_destroy(
alloc_traits::destroy(
al_,boost::addressof((spc.data()+i)->second->value()));
deallocate((spc.data()+i)->second);
}
@@ -124,12 +128,12 @@ private:
pointer allocate()
{
return allocator_allocate(al_,1);
return alloc_traits::allocate(al_,1);
}
void deallocate(Node* node)
{
allocator_deallocate(al_,static_cast<pointer>(node),1);
alloc_traits::deallocate(al_,static_cast<pointer>(node),1);
}
template<typename ValueAccess>
@@ -138,7 +142,7 @@ private:
(spc.data()+n)->first=node;
(spc.data()+n)->second=raw_ptr<Node*>(allocate());
BOOST_TRY{
allocator_construct(
alloc_traits::construct(
al_,boost::addressof((spc.data()+n)->second->value()),
access(node->value()));
}
@@ -1,4 +1,4 @@
/* Copyright 2003-2022 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)
@@ -6,9 +6,7 @@
* See http://www.boost.org/libs/multi_index for library home page.
*/
#if !defined(BOOST_CONFIG_HPP)
#error <boost/config.hpp> must be included before this header
#endif
#include <boost/config.hpp>
#if !defined(BOOST_MULTI_INDEX_DETAIL_UNDEF_IF_CONSTEXPR_MACRO)
+6 -4
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,7 +14,7 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/algorithm.hpp>
#include <boost/mpl/contains.hpp>
namespace boost{
@@ -28,7 +28,9 @@ template<typename Tag>
struct has_tag
{
template<typename Index>
using fn=mp11::mp_contains<typename Index::tag_list,Tag>;
struct apply:mpl::contains<BOOST_DEDUCED_TYPENAME Index::tag_list,Tag>
{
};
};
} /* namespace multi_index::detail */
@@ -37,4 +39,4 @@ struct has_tag
} /* namespace boost */
#endif
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,13 +14,15 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/container_hash/hash.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/functional/hash.hpp>
#include <boost/mpl/aux_/na.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/if.hpp>
#include <boost/multi_index/tag.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>
#include <functional>
#include <type_traits>
namespace boost{
@@ -44,44 +46,54 @@ namespace detail{
* argument-dependent polymorphism.
*/
template<typename KeyFromValue>
struct index_args_default_hash
{
typedef ::boost::hash<typename KeyFromValue::result_type> type;
};
template<typename KeyFromValue>
struct index_args_default_pred
{
typedef std::equal_to<typename KeyFromValue::result_type> type;
};
template<typename Arg1,typename Arg2,typename Arg3,typename Arg4>
struct hashed_index_args
{
typedef is_tag<Arg1> full_form;
typedef mp11::mp_if<
typedef typename mpl::if_<
full_form,
Arg1,
tag< > > tag_list_type;
typedef mp11::mp_if<
tag< > >::type tag_list_type;
typedef typename mpl::if_<
full_form,
Arg2,
Arg1> key_from_value_type;
typedef mp11::mp_if<
Arg1>::type key_from_value_type;
typedef typename mpl::if_<
full_form,
Arg3,
Arg2> supplied_hash_type;
typedef mp11::mp_eval_if_c<
!std::is_void<supplied_hash_type>::value,
supplied_hash_type,
boost::hash,
typename key_from_value_type::result_type
> hash_type;
typedef mp11::mp_if<
Arg2>::type supplied_hash_type;
typedef typename mpl::eval_if<
mpl::is_na<supplied_hash_type>,
index_args_default_hash<key_from_value_type>,
mpl::identity<supplied_hash_type>
>::type hash_type;
typedef typename mpl::if_<
full_form,
Arg4,
Arg3> supplied_pred_type;
typedef mp11::mp_eval_if_c<
!std::is_void<supplied_pred_type>::value,
supplied_pred_type,
std::equal_to,
typename key_from_value_type::result_type
> pred_type;
Arg3>::type supplied_pred_type;
typedef typename mpl::eval_if<
mpl::is_na<supplied_pred_type>,
index_args_default_pred<key_from_value_type>,
mpl::identity<supplied_pred_type>
>::type pred_type;
BOOST_STATIC_ASSERT(is_tag<tag_list_type>::value);
BOOST_STATIC_ASSERT(!std::is_void<key_from_value_type>::value);
BOOST_STATIC_ASSERT(!std::is_void<hash_type>::value);
BOOST_STATIC_ASSERT(!std::is_void<pred_type>::value);
BOOST_STATIC_ASSERT(!mpl::is_na<key_from_value_type>::value);
BOOST_STATIC_ASSERT(!mpl::is_na<hash_type>::value);
BOOST_STATIC_ASSERT(!mpl::is_na<pred_type>::value);
};
} /* namespace multi_index::detail */
@@ -1,4 +1,4 @@
/* 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)
@@ -14,11 +14,12 @@
#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)
#include <boost/core/serialization.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_member.hpp>
#include <boost/serialization/version.hpp>
#endif
namespace boost{
@@ -66,19 +67,15 @@ public:
* see explanation in safe_mode_iterator notes in safe_mode.hpp.
*/
template<class Archive>
void serialize(Archive& ar,const unsigned int version)
{
core::split_member(ar,*this,version);
}
BOOST_SERIALIZATION_SPLIT_MEMBER()
typedef typename Node::base_type node_base_type;
template<class Archive>
void save(Archive& ar,const unsigned int)const
{
node_base_type* bnode=get_node();
ar<<core::make_nvp("pointer",bnode);
node_base_type* bnode=node;
ar<<serialization::make_nvp("pointer",bnode);
}
template<class Archive>
@@ -92,11 +89,11 @@ public:
Archive& ar,const unsigned int version,hashed_index_global_iterator_tag)
{
node_base_type* bnode;
ar>>core::make_nvp("pointer",bnode);
node=typename Node::pointer(static_cast<Node*>(bnode));
ar>>serialization::make_nvp("pointer",bnode);
node=static_cast<Node*>(bnode);
if(version<1){
BucketArray* throw_away; /* consume unused ptr */
ar>>core::make_nvp("pointer",throw_away);
ar>>serialization::make_nvp("pointer",throw_away);
}
}
@@ -105,14 +102,14 @@ public:
Archive& ar,const unsigned int version,hashed_index_local_iterator_tag)
{
node_base_type* bnode;
ar>>core::make_nvp("pointer",bnode);
node=typename Node::pointer(static_cast<Node*>(bnode));
ar>>serialization::make_nvp("pointer",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()){
ar>>serialization::make_nvp("pointer",buckets);
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 +119,7 @@ public:
typedef Node node_type;
Node* get_node()const{return raw_ptr<Node*>(node);}
Node* get_node()const{return node;}
private:
@@ -136,7 +133,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-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)
@@ -14,7 +14,7 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/allocator_access.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
#include <utility>
@@ -99,17 +99,19 @@ struct hashed_index_node_impl;
template<typename Allocator>
struct hashed_index_base_node_impl
{
typedef allocator_rebind_t<
typedef typename rebind_alloc_for<
Allocator,hashed_index_base_node_impl
> base_allocator;
typedef allocator_rebind_t<
>::type base_allocator;
typedef typename rebind_alloc_for<
Allocator,hashed_index_node_impl<Allocator>
> node_allocator;
typedef allocator_pointer_t<base_allocator> base_pointer;
typedef allocator_const_pointer_t<base_allocator> const_base_pointer;
typedef allocator_pointer_t<node_allocator> pointer;
typedef allocator_const_pointer_t<node_allocator> const_pointer;
typedef allocator_difference_type_t<node_allocator> difference_type;
>::type node_allocator;
typedef allocator_traits<base_allocator> base_alloc_traits;
typedef allocator_traits<node_allocator> node_alloc_traits;
typedef typename base_alloc_traits::pointer base_pointer;
typedef typename base_alloc_traits::const_pointer const_base_pointer;
typedef typename node_alloc_traits::pointer pointer;
typedef typename node_alloc_traits::const_pointer const_pointer;
typedef typename node_alloc_traits::difference_type difference_type;
pointer& prior(){return prior_;}
pointer prior()const{return prior_;}
@@ -687,14 +689,14 @@ private:
template<typename Super>
struct hashed_index_node_trampoline:
hashed_index_node_impl<
allocator_rebind_t<
typename rebind_alloc_for<
typename Super::allocator_type,char
>
>::type
>
{
typedef allocator_rebind_t<
typedef typename rebind_alloc_for<
typename Super::allocator_type,char
> impl_allocator_type;
>::type impl_allocator_type;
typedef hashed_index_node_impl<impl_allocator_type> impl_type;
};
@@ -712,13 +714,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 +756,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()));
}
};
@@ -14,8 +14,8 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/list.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/size.hpp>
#include <boost/multi_index_container_fwd.hpp>
namespace boost{
@@ -53,17 +53,20 @@ struct index_access_sequence_normal
};
template<typename MultiIndexContainer,int N>
using index_access_sequence_base=mp11::mp_if_c<
N<mp11::mp_size<typename MultiIndexContainer::index_type_list>::value,
index_access_sequence_normal<MultiIndexContainer,N>,
index_access_sequence_terminal
>;
struct index_access_sequence_base:
mpl::if_c<
N<mpl::size<typename MultiIndexContainer::index_type_list>::type::value,
index_access_sequence_normal<MultiIndexContainer,N>,
index_access_sequence_terminal
>
{};
template<typename MultiIndexContainer,int N>
struct index_access_sequence:index_access_sequence_base<MultiIndexContainer,N>
struct index_access_sequence:
index_access_sequence_base<MultiIndexContainer,N>::type
{
typedef index_access_sequence_base<
MultiIndexContainer,N> super;
typedef typename index_access_sequence_base<
MultiIndexContainer,N>::type super;
index_access_sequence(MultiIndexContainer* p):super(p){}
};
+27 -25
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 Joaquin M Lopez Munoz.
/* Copyright 2003-2021 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -15,14 +15,17 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/addressof.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/mpl/vector.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/copy_map.hpp>
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
#include <boost/multi_index/detail/index_access_sequence.hpp>
#include <boost/multi_index/detail/node_handle.hpp>
#include <boost/multi_index/detail/node_type.hpp>
#include <boost/multi_index/detail/type_list.hpp>
#include <boost/multi_index/detail/vartempl_support.hpp>
#include <boost/multi_index_container_fwd.hpp>
#include <boost/tuple/tuple.hpp>
#include <utility>
@@ -60,12 +63,14 @@ protected:
typedef multi_index_container<
Value,IndexSpecifierList,Allocator> final_type;
typedef tuples::null_type ctor_args_list;
typedef Allocator final_allocator_type;
typedef typename rebind_alloc_for<
Allocator,typename Allocator::value_type
>::type final_allocator_type;
typedef node_handle<
final_node_type,final_allocator_type> final_node_handle_type;
typedef empty_type_list index_type_list;
typedef empty_type_list iterator_type_list;
typedef empty_type_list const_iterator_type_list;
typedef mpl::vector0<> index_type_list;
typedef mpl::vector0<> iterator_type_list;
typedef mpl::vector0<> const_iterator_type_list;
typedef copy_map<
final_node_type,
final_allocator_type> copy_map_type;
@@ -82,19 +87,14 @@ protected:
private:
typedef Value value_type;
typedef allocator_size_type_t<Allocator> size_type;
typedef allocator_traits<Allocator> alloc_traits;
typedef typename alloc_traits::size_type 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)
{}
@@ -120,7 +120,7 @@ protected:
{
x=final().allocate_node();
BOOST_TRY{
final().construct_value(x,std::move(const_cast<value_type&>(v)));
final().construct_value(x,boost::move(const_cast<value_type&>(v)));
}
BOOST_CATCH(...){
final().deallocate_node(x);
@@ -183,7 +183,7 @@ protected:
bool replace_(const value_type& v,index_node_type* x,rvalue_tag)
{
x->value()=std::move(const_cast<value_type&>(v));
x->value()=boost::move(const_cast<value_type&>(v));
return true;
}
@@ -241,10 +241,11 @@ protected:
std::pair<final_node_type*,bool> final_transfer_(Index& x,final_node_type* n)
{return final().transfer_(x,n);}
template<typename... Args>
std::pair<final_node_type*,bool> final_emplace_(Args&&... args)
template<BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK>
std::pair<final_node_type*,bool> final_emplace_(
BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
{
return final().emplace_(std::forward<Args>(args)...);
return final().emplace_(BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
}
std::pair<final_node_type*,bool> final_insert_(
@@ -265,11 +266,12 @@ protected:
final_node_handle_type& nh,final_node_type* position)
{return final().insert_nh_(nh,position);}
template<typename... Args>
template<BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK>
std::pair<final_node_type*,bool> final_emplace_hint_(
final_node_type* position,Args&&... args)
final_node_type* position,BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
{
return final().emplace_hint_(position,std::forward<Args>(args)...);
return final().emplace_hint_(
position,BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
}
final_node_handle_type final_extract_(final_node_type* x)
@@ -292,8 +294,8 @@ protected:
template<typename Index>
void final_transfer_range_(
Index& x,
typename Index::iterator first,
typename Index::iterator last)
BOOST_DEDUCED_TYPENAME Index::iterator first,
BOOST_DEDUCED_TYPENAME Index::iterator last)
{final().transfer_range_(x,first,last);}
void final_swap_(final_type& x){final().swap_(x);}
@@ -1,4 +1,4 @@
/* Copyright 2003-2023 Joaquin M Lopez Munoz.
/* Copyright 2003-2022 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -15,11 +15,11 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/archive/archive_exception.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/core/serialization.hpp>
#include <boost/multi_index/detail/auto_space.hpp>
#include <boost/multi_index/detail/bad_archive_exception.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/throw_exception.hpp>
#include <cstddef>
@@ -30,8 +30,7 @@ namespace multi_index{
namespace detail{
/* Counterpart of index_saver (check index_saver.hpp for serialization
* details.)
* multi_index_container is in charge of supplying the info about
* details.)* multi_index_container is in charge of supplying the info about
* the base sequence, and each index can subsequently load itself using the
* const interface of index_loader.
*/
@@ -48,14 +47,14 @@ public:
template<class Archive>
void add(Node* node,Archive& ar,const unsigned int)
{
ar>>core::make_nvp("position",*node);
ar>>serialization::make_nvp("position",*node);
entries()[n++]=node;
}
template<class Archive>
void add_track(Node* node,Archive& ar,const unsigned int)
{
ar>>core::make_nvp("position",*node);
ar>>serialization::make_nvp("position",*node);
}
/* A rearranger is passed two nodes, and is expected to
@@ -103,7 +102,7 @@ private:
FinalNode* unchecked_load_node(Archive& ar)const
{
Node* node=0;
ar>>core::make_nvp("pointer",node);
ar>>serialization::make_nvp("pointer",node);
return static_cast<FinalNode*>(node);
}
@@ -111,7 +110,7 @@ private:
FinalNode* load_node(Archive& ar)const
{
Node* node=0;
ar>>core::make_nvp("pointer",node);
ar>>serialization::make_nvp("pointer",node);
check_node(node);
return static_cast<FinalNode*>(node);
}
@@ -119,7 +118,9 @@ private:
void check_node(Node* node)const
{
if(node!=0&&!std::binary_search(entries(),entries()+size_,node)){
throw_exception(bad_archive_exception());
throw_exception(
archive::archive_exception(
archive::archive_exception::other_exception));
}
}
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2016 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)
@@ -18,8 +18,8 @@
#include <boost/type_traits/alignment_of.hpp>
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
#include <boost/core/serialization.hpp>
#include <boost/multi_index/detail/bad_archive_exception.hpp>
#include <boost/archive/archive_exception.hpp>
#include <boost/serialization/access.hpp>
#include <boost/throw_exception.hpp>
#endif
@@ -105,19 +105,28 @@ Node* node_from_value(const Value* p)
* somehow invalid archive.
*/
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
namespace serialization{
#else
namespace multi_index{
namespace detail{
#endif
template<class Archive,typename Value,typename Allocator>
inline void load_construct_data(
Archive&,boost::multi_index::detail::index_node_base<Value,Allocator>*,
const unsigned int)
{
throw_exception(boost::multi_index::detail::bad_archive_exception());
throw_exception(
archive::archive_exception(archive::archive_exception::other_exception));
}
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)
} /* namespace serialization */
#else
} /* namespace multi_index::detail */
} /* namespace multi_index */
#endif
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2023 Joaquin M Lopez Munoz.
/* Copyright 2003-2022 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,7 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/multi_index/detail/index_matcher.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/core/serialization.hpp>
#include <boost/serialization/nvp.hpp>
#include <cstddef>
namespace boost{
@@ -43,14 +43,14 @@ public:
template<class Archive>
void add(Node* node,Archive& ar,const unsigned int)
{
ar<<core::make_nvp("position",*node);
ar<<serialization::make_nvp("position",*node);
alg.add(node);
}
template<class Archive>
void add_track(Node* node,Archive& ar,const unsigned int)
{
ar<<core::make_nvp("position",*node);
ar<<serialization::make_nvp("position",*node);
}
template<typename IndexIterator,class Archive>
@@ -120,7 +120,7 @@ private:
template<typename Archive>
static void save_node(Node* node,Archive& ar)
{
ar<<core::make_nvp("pointer",node);
ar<<serialization::make_nvp("pointer",node);
}
index_matcher::algorithm<Node,Allocator> alg;
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2019 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,8 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/workaround.hpp>
#if BOOST_WORKAROUND(_LIBCPP_VERSION,<30700)||\
#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)||\
BOOST_WORKAROUND(_LIBCPP_VERSION,<30700)||\
BOOST_WORKAROUND(BOOST_LIBSTDCXX_VERSION,<40802)
/* libc++: std::is_function<void() const> fails,
* https://bugs.llvm.org/show_bug.cgi?id=20084
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,18 +14,8 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#if defined(BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT)
#include <boost/multi_index/detail/mpl_to_mp11_list.hpp>
#define BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER \
<boost/mpl/empty.hpp>
#include BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#undef BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#define BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER \
<boost/mpl/is_sequence.hpp>
#include BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#undef BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#include <type_traits>
#include <boost/mpl/empty.hpp>
#include <boost/mpl/is_sequence.hpp>
namespace boost{
@@ -33,48 +23,18 @@ namespace multi_index{
namespace detail{
/* an index list is a non-empty MPL sequence */
template<typename T>
struct is_index_list
{
BOOST_STATIC_CONSTANT(bool,mpl_sequence=mpl::is_sequence<T>::value);
BOOST_STATIC_CONSTANT(bool,non_empty=!(std::conditional<
mpl_sequence,mpl::empty<T>,std::false_type>::type::value));
BOOST_STATIC_CONSTANT(bool,non_empty=!mpl::empty<T>::value);
BOOST_STATIC_CONSTANT(bool,value=mpl_sequence&&non_empty);
};
template<typename IndexList>
using mp11_index_list=mpl_to_mp11_list<IndexList>;
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#else
#include <type_traits>
namespace boost{
namespace multi_index{
namespace detail{
template<typename T>
struct is_index_list:std::false_type{};
/* an index list is a non-empty Mp11 list */
template<template<typename...> class L,typename T,typename... Ts>
struct is_index_list<L<T,Ts...>>:std::true_type{};
template<typename IndexList>
using mp11_index_list=IndexList;
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2014 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,8 +14,8 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/intrinsics.hpp>
#include <type_traits>
namespace boost{
@@ -29,7 +29,7 @@ namespace detail{
*/
template<typename F,typename Arg1,typename Arg2,typename=void>
struct is_transparent:std::true_type{};
struct is_transparent:mpl::true_{};
} /* namespace multi_index::detail */
@@ -37,17 +37,21 @@ struct is_transparent:std::true_type{};
} /* namespace boost */
#if !defined(BOOST_NO_SFINAE_EXPR)&& \
#if !defined(BOOST_NO_SFINAE)&&!defined(BOOST_NO_SFINAE_EXPR)&& \
!defined(BOOST_NO_CXX11_DECLTYPE)&& \
(defined(BOOST_NO_CXX11_FINAL)||defined(BOOST_IS_FINAL))
#include <boost/core/enable_if.hpp>
#include <boost/type_traits/declval.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/or.hpp>
#include <boost/type_traits/function_traits.hpp>
#include <boost/type_traits/is_class.hpp>
#include <boost/type_traits/is_final.hpp>
#include <boost/type_traits/is_function.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_pointer.hpp>
#include <boost/utility/declval.hpp>
#include <boost/utility/enable_if.hpp>
namespace boost{
@@ -66,7 +70,7 @@ struct is_transparent_class_helper:F
};
template<typename F,typename Arg1,typename Arg2,typename=void>
struct is_transparent_class:std::true_type{};
struct is_transparent_class:mpl::true_{};
template<typename F,typename Arg1,typename Arg2>
struct is_transparent_class<
@@ -80,31 +84,38 @@ struct is_transparent_class<
not_is_transparent_result_type
>
>::type
>:std::false_type{};
>:mpl::false_{};
template<typename F,typename Arg1,typename Arg2>
struct is_transparent<
F,Arg1,Arg2,
typename enable_if_c<
is_class<F>::value&&
!is_final<F>::value /* is_transparent_class_helper derives from F */
typename enable_if<
mpl::and_<
is_class<F>,
mpl::not_<is_final<F> > /* is_transparent_class_helper derives from F */
>
>::type
>:is_transparent_class<F,Arg1,Arg2>{};
template<typename F,typename Arg1,typename Arg2,typename=void>
struct is_transparent_function:std::true_type{};
struct is_transparent_function:mpl::true_{};
template<typename F,typename Arg1,typename Arg2>
struct is_transparent_function<
F,Arg1,Arg2,
typename enable_if_c<
!(is_same<typename function_traits<F>::arg1_type,const Arg1&>::value||
is_same<typename function_traits<F>::arg1_type,Arg1>::value)
||
!(is_same<typename function_traits<F>::arg2_type,const Arg2&>::value||
is_same<typename function_traits<F>::arg2_type,Arg2>::value)
typename enable_if<
mpl::or_<
mpl::not_<mpl::or_<
is_same<typename function_traits<F>::arg1_type,const Arg1&>,
is_same<typename function_traits<F>::arg1_type,Arg1>
> >,
mpl::not_<mpl::or_<
is_same<typename function_traits<F>::arg2_type,const Arg2&>,
is_same<typename function_traits<F>::arg2_type,Arg2>
> >
>
>::type
>:std::false_type{};
>:mpl::false_{};
template<typename F,typename Arg1,typename Arg2>
struct is_transparent<
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,7 +14,7 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/utility.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/operators.hpp>
namespace boost{
@@ -125,7 +125,10 @@ template<>
struct iter_adaptor_selector<std::forward_iterator_tag>
{
template<class Derived,class Base>
using fn=forward_iter_adaptor_base<Derived,Base>;
struct apply
{
typedef forward_iter_adaptor_base<Derived,Base> type;
};
};
template<class Derived,class Base>
@@ -180,7 +183,10 @@ template<>
struct iter_adaptor_selector<std::bidirectional_iterator_tag>
{
template<class Derived,class Base>
using fn=bidirectional_iter_adaptor_base<Derived,Base>;
struct apply
{
typedef bidirectional_iter_adaptor_base<Derived,Base> type;
};
};
template<class Derived,class Base>
@@ -277,17 +283,23 @@ template<>
struct iter_adaptor_selector<std::random_access_iterator_tag>
{
template<class Derived,class Base>
using fn=random_access_iter_adaptor_base<Derived,Base>;
struct apply
{
typedef random_access_iter_adaptor_base<Derived,Base> type;
};
};
template<class Derived,class Base>
using iter_adaptor_base=mp11::mp_invoke_q<
iter_adaptor_selector<typename Base::iterator_category>,
Derived,Base
>;
struct iter_adaptor_base
{
typedef iter_adaptor_selector<
typename Base::iterator_category> selector;
typedef typename mpl::apply2<
selector,Derived,Base>::type type;
};
template<class Derived,class Base>
class iter_adaptor:public iter_adaptor_base<Derived,Base>
class iter_adaptor:public iter_adaptor_base<Derived,Base>::type
{
protected:
iter_adaptor(){}
@@ -1,62 +0,0 @@
/* 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)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_MPL_TO_MP11_LIST_HPP
#define BOOST_MULTI_INDEX_DETAIL_MPL_TO_MP11_LIST_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#if defined(BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT)
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/list.hpp>
#define BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER \
<boost/mpl/begin_end.hpp>
#include BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#undef BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#define BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER \
<boost/mpl/deref.hpp>
#include BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#undef BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#define BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER \
<boost/mpl/next.hpp>
#include BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#undef BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
namespace boost{
namespace multi_index{
namespace detail{
template<typename First,typename Last,typename... Ts>
struct mpl_to_mp11_list_impl:mpl_to_mp11_list_impl<
typename mpl::next<First>::type,Last,
Ts...,typename mpl::deref<First>::type
>{};
template<typename Last,typename... Ts>
struct mpl_to_mp11_list_impl<Last,Last,Ts...>
{
using type=mp11::mp_list<Ts...>;
};
template<typename TypeList>
using mpl_to_mp11_list=typename mpl_to_mp11_list_impl<
typename mpl::begin<TypeList>::type,
typename boost::mpl::end<TypeList>::type
>::type;
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,8 +14,8 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/algorithm.hpp>
#include <type_traits>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/set/set0.hpp>
namespace boost{
@@ -25,11 +25,68 @@ namespace detail{
/* no_duplicate_tags check at compile-time that a tag list
* has no duplicate tags.
* The algorithm deserves some explanation: tags
* are sequentially inserted into a mpl::set if they were
* not already present. Due to the magic of mpl::set
* (mpl::has_key is contant time), this operation takes linear
* time, and even MSVC++ 6.5 handles it gracefully (other obvious
* solutions are quadratic.)
*/
struct duplicate_tag_mark{};
struct duplicate_tag_marker
{
template <typename MplSet,typename Tag>
struct apply
{
typedef mpl::s_item<
typename mpl::if_<mpl::has_key<MplSet,Tag>,duplicate_tag_mark,Tag>::type,
MplSet
> type;
};
};
template<typename TagList>
using no_duplicate_tags=
std::is_same<TagList,mp11::mp_unique<TagList>>;
struct no_duplicate_tags
{
typedef typename mpl::fold<
TagList,
mpl::set0<>,
duplicate_tag_marker
>::type aux;
BOOST_STATIC_CONSTANT(
bool,value=!(mpl::has_key<aux,duplicate_tag_mark>::value));
};
/* Variant for an index list: duplication is checked
* across all the indices.
*/
struct duplicate_tag_list_marker
{
template <typename MplSet,typename Index>
struct apply:mpl::fold<
BOOST_DEDUCED_TYPENAME Index::tag_list,
MplSet,
duplicate_tag_marker>
{
};
};
template<typename IndexList>
struct no_duplicate_tags_in_index_list
{
typedef typename mpl::fold<
IndexList,
mpl::set0<>,
duplicate_tag_list_marker
>::type aux;
BOOST_STATIC_CONSTANT(
bool,value=!(mpl::has_key<aux,duplicate_tag_mark>::value));
};
} /* namespace multi_index::detail */
@@ -1,44 +0,0 @@
/* 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)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_NO_DUPLICATE_TAGS_IN_INDEX_LIST_HPP
#define BOOST_MULTI_INDEX_DETAIL_NO_DUPLICATE_TAGS_IN_INDEX_LIST_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/multi_index/tag.hpp>
#include <boost/mp11/algorithm.hpp>
#include <boost/mp11/list.hpp>
#include <type_traits>
namespace boost{
namespace multi_index{
namespace detail{
/* checks duplication of tags across all indices of a container */
template<typename Index>
using index_tag_list=mp11::mp_rename<
mp11_tag_list<typename Index::tag_list>,mp11::mp_list>;
template<typename IndexList>
using no_duplicate_tags_in_index_list=no_duplicate_tags<
mp11::mp_flatten<mp11::mp_transform<index_tag_list,IndexList>>>;
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2021 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -16,16 +16,20 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/core/addressof.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/multi_index_container_fwd.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/type_traits/aligned_storage.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <new>
#if !defined(BOOST_NO_SFINAE)
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_same.hpp>
#include <new>
#include <utility>
#include <boost/utility/enable_if.hpp>
#endif
namespace boost{
@@ -45,12 +49,16 @@ public:
typedef typename Node::value_type value_type;
typedef Allocator allocator_type;
private:
typedef allocator_traits<allocator_type> alloc_traits;
public:
node_handle()BOOST_NOEXCEPT:node(0){}
node_handle(node_handle&& x)BOOST_NOEXCEPT:node(x.node)
node_handle(BOOST_RV_REF(node_handle) x)BOOST_NOEXCEPT:node(x.node)
{
if(!x.empty()){
move_construct_allocator(std::move(x));
move_construct_allocator(boost::move(x));
x.destroy_allocator();
x.node=0;
}
@@ -64,16 +72,15 @@ public:
}
}
node_handle& operator=(node_handle&& x)
node_handle& operator=(BOOST_RV_REF(node_handle) x)
{
if(this!=&x){
if(!empty()){
delete_node();
if(!x.empty()){
BOOST_MULTI_INDEX_IF_CONSTEXPR(
allocator_propagate_on_container_move_assignment_t<
allocator_type>::value){
move_assign_allocator(std::move(x));
alloc_traits::propagate_on_container_move_assignment::value){
move_assign_allocator(boost::move(x));
}
x.destroy_allocator();
}
@@ -82,7 +89,7 @@ public:
}
}
else if(!x.empty()){
move_construct_allocator(std::move(x));
move_construct_allocator(boost::move(x));
x.destroy_allocator();
}
node=x.node;
@@ -108,24 +115,24 @@ public:
void swap(node_handle& x)
BOOST_NOEXCEPT_IF(
allocator_propagate_on_container_swap_t<allocator_type>::value||
allocator_is_always_equal_t<allocator_type>::value)
alloc_traits::propagate_on_container_swap::value||
alloc_traits::is_always_equal::value)
{
if(!empty()){
if(!x.empty()){
BOOST_MULTI_INDEX_IF_CONSTEXPR(
allocator_propagate_on_container_swap_t<allocator_type>::value){
alloc_traits::propagate_on_container_swap::value){
using std::swap;
swap(*allocator_ptr(),*x.allocator_ptr());
}
}
else{
x.move_construct_allocator(std::move(*this));
x.move_construct_allocator(boost::move(*this));
destroy_allocator();
}
}
else if(!x.empty()){
move_construct_allocator(std::move(x));
move_construct_allocator(boost::move(x));
x.destroy_allocator();
}
std::swap(node,x.node);
@@ -138,6 +145,8 @@ public:
}
private:
BOOST_MOVABLE_BUT_NOT_COPYABLE(node_handle)
template <typename,typename,typename>
friend class boost::multi_index::multi_index_container;
@@ -168,27 +177,30 @@ private:
#include <boost/multi_index/detail/restore_wstrict_aliasing.hpp>
void move_construct_allocator(node_handle&& x)
void move_construct_allocator(BOOST_RV_REF(node_handle) x)
{
::new (static_cast<void*>(allocator_ptr()))
allocator_type(std::move(*x.allocator_ptr()));
allocator_type(boost::move(*x.allocator_ptr()));
}
void move_assign_allocator(node_handle&& x)
void move_assign_allocator(BOOST_RV_REF(node_handle) x)
{
*allocator_ptr()=std::move(*x.allocator_ptr());
*allocator_ptr()=boost::move(*x.allocator_ptr());
}
void destroy_allocator(){allocator_ptr()->~allocator_type();}
void delete_node()
{
typedef allocator_rebind_t<allocator_type,Node> node_allocator;
typedef allocator_pointer_t<node_allocator> node_pointer;
typedef typename rebind_alloc_for<
allocator_type,Node
>::type node_allocator;
typedef detail::allocator_traits<node_allocator> node_alloc_traits;
typedef typename node_alloc_traits::pointer node_pointer;
allocator_destroy(*allocator_ptr(),boost::addressof(node->value()));
alloc_traits::destroy(*allocator_ptr(),boost::addressof(node->value()));
node_allocator nal(*allocator_ptr());
allocator_deallocate(nal,static_cast<node_pointer>(node),1);
node_alloc_traits::deallocate(nal,static_cast<node_pointer>(node),1);
}
Node* node;
@@ -208,26 +220,31 @@ template<typename Iterator,typename NodeHandle>
struct insert_return_type
{
insert_return_type(
Iterator position_,bool inserted_,NodeHandle&& node_):
position(position_),inserted(inserted_),node(std::move(node_)){}
insert_return_type(insert_return_type&& x):
position(x.position),inserted(x.inserted),node(std::move(x.node)){}
Iterator position_,bool inserted_,BOOST_RV_REF(NodeHandle) node_):
position(position_),inserted(inserted_),node(boost::move(node_)){}
insert_return_type(BOOST_RV_REF(insert_return_type) x):
position(x.position),inserted(x.inserted),node(boost::move(x.node)){}
insert_return_type& operator=(insert_return_type&& x)
insert_return_type& operator=(BOOST_RV_REF(insert_return_type) x)
{
position=x.position;
inserted=x.inserted;
node=std::move(x.node);
node=boost::move(x.node);
return *this;
}
Iterator position;
bool inserted;
NodeHandle node;
private:
BOOST_MOVABLE_BUT_NOT_COPYABLE(insert_return_type)
};
/* utility for SFINAEing merge and related operations */
#if !defined(BOOST_NO_SFINAE)
#define BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(Dst,Src,T) \
typename enable_if_c< \
!is_const< Dst >::value&&!is_const< Src >::value&& \
@@ -235,6 +252,12 @@ typename enable_if_c< \
T \
>::type
#else
#define BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(Dst,Src,T) T
#endif
} /* namespace multi_index::detail */
} /* namespace multi_index */
+20 -9
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,7 +14,10 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/algorithm.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mpl/bind.hpp>
#include <boost/mpl/reverse_iter_fold.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/multi_index_container_fwd.hpp>
#include <boost/multi_index/detail/header_holder.hpp>
#include <boost/multi_index/detail/index_node_base.hpp>
@@ -27,23 +30,31 @@ namespace multi_index{
namespace detail{
/* Mp11 machinery to construct the internal node type associated to an
/* MPL machinery to construct the internal node type associated to an
* index list.
*/
template<typename IndexSpecifier,typename Super>
using node_type=typename IndexSpecifier::template node_class<Super>::type;
struct index_node_applier
{
template<typename IndexSpecifierIterator,typename Super>
struct apply
{
typedef typename mpl::deref<IndexSpecifierIterator>::type index_specifier;
typedef typename index_specifier::
BOOST_NESTED_TEMPLATE node_class<Super>::type type;
};
};
template<typename Value,typename IndexSpecifierList,typename Allocator>
struct multi_index_node_type
{
BOOST_STATIC_ASSERT(detail::is_index_list<IndexSpecifierList>::value);
typedef mp11::mp_reverse_fold<
detail::mp11_index_list<IndexSpecifierList>,
typedef typename mpl::reverse_iter_fold<
IndexSpecifierList,
index_node_base<Value,Allocator>,
node_type
> type;
mpl::bind2<index_node_applier,mpl::_2,mpl::_1>
>::type type;
};
} /* namespace multi_index::detail */
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,11 +14,14 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/utility.hpp>
#include <boost/mpl/aux_/na.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/if.hpp>
#include <boost/multi_index/tag.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/is_same.hpp>
#include <functional>
#include <type_traits>
namespace boost{
@@ -37,33 +40,38 @@ namespace detail{
* polymorphism.
*/
template<typename KeyFromValue>
struct index_args_default_compare
{
typedef std::less<typename KeyFromValue::result_type> type;
};
template<typename Arg1,typename Arg2,typename Arg3>
struct ordered_index_args
{
typedef is_tag<Arg1> full_form;
typedef mp11::mp_if<
typedef typename mpl::if_<
full_form,
Arg1,
tag< > > tag_list_type;
typedef mp11::mp_if<
tag< > >::type tag_list_type;
typedef typename mpl::if_<
full_form,
Arg2,
Arg1> key_from_value_type;
typedef mp11::mp_if<
Arg1>::type key_from_value_type;
typedef typename mpl::if_<
full_form,
Arg3,
Arg2> supplied_compare_type;
typedef mp11::mp_eval_if_c<
!std::is_void<supplied_compare_type>::value,
supplied_compare_type,
std::less,
typename key_from_value_type::result_type
> compare_type;
Arg2>::type supplied_compare_type;
typedef typename mpl::eval_if<
mpl::is_na<supplied_compare_type>,
index_args_default_compare<key_from_value_type>,
mpl::identity<supplied_compare_type>
>::type compare_type;
BOOST_STATIC_ASSERT(is_tag<tag_list_type>::value);
BOOST_STATIC_ASSERT(!std::is_void<key_from_value_type>::value);
BOOST_STATIC_ASSERT(!std::is_void<compare_type>::value);
BOOST_STATIC_ASSERT(!mpl::is_na<key_from_value_type>::value);
BOOST_STATIC_ASSERT(!mpl::is_na<compare_type>::value);
};
} /* namespace multi_index::detail */
@@ -72,4 +80,4 @@ struct ordered_index_args
} /* namespace boost */
#endif
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 Joaquin M Lopez Munoz.
/* Copyright 2003-2022 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -44,11 +44,19 @@
#include <algorithm>
#include <boost/call_traits.hpp>
#include <boost/core/addressof.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/core/ref.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/foreach_fwd.hpp>
#include <boost/iterator/reverse_iterator.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/adl_swap.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/bidir_node_iterator.hpp>
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
#include <boost/multi_index/detail/index_node_base.hpp>
@@ -59,20 +67,21 @@
#include <boost/multi_index/detail/ord_index_ops.hpp>
#include <boost/multi_index/detail/safe_mode.hpp>
#include <boost/multi_index/detail/scope_guard.hpp>
#include <boost/multi_index/detail/type_list.hpp>
#include <boost/multi_index/detail/unbounded.hpp>
#include <boost/multi_index/detail/value_compare.hpp>
#include <boost/multi_index/detail/vartempl_support.hpp>
#include <boost/multi_index/detail/ord_index_impl_fwd.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/type_traits/is_same.hpp>
#include <initializer_list>
#include <iterator>
#include <type_traits>
#include <utility>
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
#include <initializer_list>
#endif
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
#include <boost/archive/archive_exception.hpp>
#include <boost/bind/bind.hpp>
#include <boost/multi_index/detail/bad_archive_exception.hpp>
#include <boost/multi_index/detail/duplicates_iterator.hpp>
#include <boost/throw_exception.hpp>
#endif
@@ -122,10 +131,24 @@ template<
typename KeyFromValue,typename Compare,
typename SuperMeta,typename TagList,typename Category,typename AugmentPolicy
>
class ordered_index_impl:protected SuperMeta::type
class ordered_index_impl:
BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS SuperMeta::type
{
#if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING)&&\
BOOST_WORKAROUND(__MWERKS__,<=0x3003)
/* The "ISO C++ Template Parser" option in CW8.3 has a problem with the
* lifetime of const references bound to temporaries --precisely what
* scopeguards are.
*/
#pragma parse_mfunc_templ off
#endif
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
/* cross-index access */
template <typename,typename,typename> friend class index_base;
#endif
typedef typename SuperMeta::type super;
@@ -159,15 +182,19 @@ public:
#endif
typedef iterator const_iterator;
typedef allocator_size_type_t<allocator_type> size_type;
typedef allocator_difference_type_t<
allocator_type> difference_type;
typedef allocator_pointer_t<allocator_type> pointer;
typedef allocator_const_pointer_t<allocator_type> const_pointer;
private:
typedef allocator_traits<allocator_type> alloc_traits;
public:
typedef typename alloc_traits::size_type size_type;
typedef typename alloc_traits::difference_type difference_type;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::const_pointer const_pointer;
typedef typename
std::reverse_iterator<iterator> reverse_iterator;
boost::reverse_iterator<iterator> reverse_iterator;
typedef typename
std::reverse_iterator<const_iterator> const_reverse_iterator;
boost::reverse_iterator<const_iterator> const_reverse_iterator;
typedef typename super::final_node_handle_type node_type;
typedef detail::insert_return_type<
iterator,node_type> insert_return_type;
@@ -178,18 +205,18 @@ protected:
typedef tuples::cons<
ctor_args,
typename super::ctor_args_list> ctor_args_list;
typedef type_list_push_front<
typedef typename mpl::push_front<
typename super::index_type_list,
ordered_index<
KeyFromValue,Compare,
SuperMeta,TagList,Category,AugmentPolicy
>> index_type_list;
typedef type_list_push_front<
> >::type index_type_list;
typedef typename mpl::push_front<
typename super::iterator_type_list,
iterator> iterator_type_list;
typedef type_list_push_front<
iterator>::type iterator_type_list;
typedef typename mpl::push_front<
typename super::const_iterator_type_list,
const_iterator> const_iterator_type_list;
const_iterator>::type const_iterator_type_list;
typedef typename super::copy_map_type copy_map_type;
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
@@ -235,13 +262,13 @@ public:
const_iterator
end()const BOOST_NOEXCEPT{return make_iterator(header());}
reverse_iterator
rbegin()BOOST_NOEXCEPT{return reverse_iterator{end()};}
rbegin()BOOST_NOEXCEPT{return boost::make_reverse_iterator(end());}
const_reverse_iterator
rbegin()const BOOST_NOEXCEPT{return const_reverse_iterator{end()};}
rbegin()const BOOST_NOEXCEPT{return boost::make_reverse_iterator(end());}
reverse_iterator
rend()BOOST_NOEXCEPT{return reverse_iterator{begin()};}
rend()BOOST_NOEXCEPT{return boost::make_reverse_iterator(begin());}
const_reverse_iterator
rend()const BOOST_NOEXCEPT{return const_reverse_iterator{begin()};}
rend()const BOOST_NOEXCEPT{return boost::make_reverse_iterator(begin());}
const_iterator
cbegin()const BOOST_NOEXCEPT{return begin();}
const_iterator
@@ -271,27 +298,11 @@ public:
/* modifiers */
template<typename... Args>
std::pair<iterator,bool> emplace(Args&&... args)
{
BOOST_MULTI_INDEX_ORD_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool>p=
this->final_emplace_(std::forward<Args>(args)...);
return std::pair<iterator,bool>(make_iterator(p.first),p.second);
}
BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL(
pair_return_type,emplace,emplace_impl)
template<typename... Args>
iterator emplace_hint(iterator position,Args&&... args)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_IS_OWNER(position,*this);
BOOST_MULTI_INDEX_ORD_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool>p=
this->final_emplace_hint_(
static_cast<final_node_type*>(position.get_node()),
std::forward<Args>(args)...);
return make_iterator(p.first);
}
BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG(
iterator,emplace_hint,emplace_hint_impl,iterator,position)
std::pair<iterator,bool> insert(const value_type& x)
{
@@ -300,7 +311,7 @@ public:
return std::pair<iterator,bool>(make_iterator(p.first),p.second);
}
std::pair<iterator,bool> insert(value_type&& x)
std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
{
BOOST_MULTI_INDEX_ORD_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool> p=this->final_insert_rv_(x);
@@ -317,7 +328,7 @@ public:
return make_iterator(p.first);
}
iterator insert(iterator position,value_type&& x)
iterator insert(iterator position,BOOST_RV_REF(value_type) x)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_IS_OWNER(position,*this);
@@ -331,23 +342,30 @@ public:
void insert(InputIterator first,InputIterator last)
{
BOOST_MULTI_INDEX_ORD_INDEX_CHECK_INVARIANT;
for(;first!=last;++first)this->final_insert_ref_(*first);
index_node_type* hint=header(); /* end() */
for(;first!=last;++first){
hint=this->final_insert_ref_(
*first,static_cast<final_node_type*>(hint)).first;
index_node_type::increment(hint);
}
}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
void insert(std::initializer_list<value_type> list)
{
insert(list.begin(),list.end());
}
#endif
insert_return_type insert(node_type&& nh)
insert_return_type insert(BOOST_RV_REF(node_type) nh)
{
if(nh)BOOST_MULTI_INDEX_CHECK_EQUAL_ALLOCATORS(*this,nh);
BOOST_MULTI_INDEX_ORD_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool> p=this->final_insert_nh_(nh);
return insert_return_type(make_iterator(p.first),p.second,std::move(nh));
return insert_return_type(make_iterator(p.first),p.second,boost::move(nh));
}
iterator insert(const_iterator position,node_type&& nh)
iterator insert(const_iterator position,BOOST_RV_REF(node_type) nh)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_IS_OWNER(position,*this);
@@ -421,7 +439,7 @@ public:
x,static_cast<final_node_type*>(position.get_node()));
}
bool replace(iterator position,value_type&& x)
bool replace(iterator position,BOOST_RV_REF(value_type) x)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(position);
@@ -521,12 +539,12 @@ public:
template<typename Index>
BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(ordered_index_impl,Index,void)
merge(Index&& x){merge(static_cast<Index&>(x));}
merge(BOOST_RV_REF(Index) x){merge(static_cast<Index&>(x));}
template<typename Index>
BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(
ordered_index_impl,Index,pair_return_type)
merge(Index& x,typename Index::iterator i)
merge(Index& x,BOOST_DEDUCED_TYPENAME Index::iterator i)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(i);
BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(i);
@@ -547,7 +565,7 @@ public:
template<typename Index>
BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(
ordered_index_impl,Index,pair_return_type)
merge(Index&& x,typename Index::iterator i)
merge(BOOST_RV_REF(Index) x,BOOST_DEDUCED_TYPENAME Index::iterator i)
{
return merge(static_cast<Index&>(x),i);
}
@@ -556,8 +574,8 @@ public:
BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(ordered_index_impl,Index,void)
merge(
Index& x,
typename Index::iterator first,
typename Index::iterator last)
BOOST_DEDUCED_TYPENAME Index::iterator first,
BOOST_DEDUCED_TYPENAME Index::iterator last)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(first);
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(last);
@@ -574,9 +592,9 @@ public:
template<typename Index>
BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(ordered_index_impl,Index,void)
merge(
Index&& x,
typename Index::iterator first,
typename Index::iterator last)
BOOST_RV_REF(Index) x,
BOOST_DEDUCED_TYPENAME Index::iterator first,
BOOST_DEDUCED_TYPENAME Index::iterator last)
{
merge(static_cast<Index&>(x),first,last);
}
@@ -689,28 +707,26 @@ public:
std::pair<iterator,iterator>
range(LowerBounder lower,UpperBounder upper)const
{
typedef typename mp11::mp_if<
typedef typename mpl::if_<
is_same<LowerBounder,unbounded_type>,
mp11::mp_if<
BOOST_DEDUCED_TYPENAME mpl::if_<
is_same<UpperBounder,unbounded_type>,
both_unbounded_tag,
lower_unbounded_tag
>,
mp11::mp_if<
>::type,
BOOST_DEDUCED_TYPENAME mpl::if_<
is_same<UpperBounder,unbounded_type>,
upper_unbounded_tag,
none_unbounded_tag
>
> dispatch;
>::type
>::type dispatch;
return range(lower,upper,dispatch());
}
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),
BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
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 +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):
super(x,al,h),
KeyFromValue,Compare,SuperMeta,TagList,Category,AugmentPolicy>& x):
super(x),
key(x.key),
comp_(x.comp_)
@@ -743,9 +758,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_)
@@ -1343,6 +1357,29 @@ private:
}
#endif
template<BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK>
std::pair<iterator,bool> emplace_impl(BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
{
BOOST_MULTI_INDEX_ORD_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool>p=
this->final_emplace_(BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
return std::pair<iterator,bool>(make_iterator(p.first),p.second);
}
template<BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK>
iterator emplace_hint_impl(
iterator position,BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_IS_OWNER(position,*this);
BOOST_MULTI_INDEX_ORD_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool>p=
this->final_emplace_hint_(
static_cast<final_node_type*>(position.get_node()),
BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
return make_iterator(p.first);
}
template<typename LowerBounder,typename UpperBounder>
std::pair<iterator,iterator>
range(LowerBounder lower,UpperBounder upper,none_unbounded_tag)const
@@ -1476,7 +1513,9 @@ private:
}
else if(comp_(key(x->value()),key(position->value()))){
/* inconsistent rearrangement */
throw_exception(bad_archive_exception());
throw_exception(
archive::archive_exception(
archive::archive_exception::other_exception));
}
else index_node_type::increment(position);
@@ -1496,6 +1535,11 @@ protected: /* for the benefit of AugmentPolicy::augmented_interface */
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
safe_container safe;
#endif
#if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING)&&\
BOOST_WORKAROUND(__MWERKS__,<=0x3003)
#pragma parse_mfunc_templ reset
#endif
};
template<
@@ -1516,10 +1560,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;
@@ -1536,27 +1576,24 @@ public:
return *this;
}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
ordered_index& operator=(
std::initializer_list<typename super::value_type> list)
std::initializer_list<BOOST_DEDUCED_TYPENAME super::value_type> list)
{
this->final()=list;
return *this;
}
#endif
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)
@@ -1690,22 +1727,16 @@ void swap(
/* Boost.Foreach compatibility */
namespace boost{
namespace foreach{
template<typename>
struct is_noncopyable;
template<
typename KeyFromValue,typename Compare,
typename SuperMeta,typename TagList,typename Category,typename AugmentPolicy
>
struct is_noncopyable<
inline boost::mpl::true_* boost_foreach_is_noncopyable(
boost::multi_index::detail::ordered_index<
KeyFromValue,Compare,SuperMeta,TagList,Category,AugmentPolicy>
>:std::true_type{};
}
KeyFromValue,Compare,SuperMeta,TagList,Category,AugmentPolicy>*&,
boost_foreach_argument_dependent_lookup_hack)
{
return 0;
}
#undef BOOST_MULTI_INDEX_ORD_INDEX_CHECK_INVARIANT
@@ -1,4 +1,4 @@
/* 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)
@@ -41,12 +41,13 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/allocator_access.hpp>
#include <cstddef>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
#if !defined(BOOST_MULTI_INDEX_DISABLE_COMPRESSED_ORDERED_INDEX_NODES)
#include <boost/mp11/utility.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/if.hpp>
#include <boost/multi_index/detail/uintptr_type.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/type_traits/is_same.hpp>
@@ -69,14 +70,15 @@ struct ordered_index_node_impl; /* fwd decl. */
template<typename AugmentPolicy,typename Allocator>
struct ordered_index_node_traits
{
typedef allocator_rebind_t<
typedef typename rebind_alloc_for<
Allocator,
ordered_index_node_impl<AugmentPolicy,Allocator>
> allocator;
typedef allocator_pointer_t<allocator> pointer;
typedef allocator_const_pointer_t<allocator> const_pointer;
typedef allocator_difference_type_t<allocator> difference_type;
typedef allocator_size_type_t<allocator> size_type;
>::type allocator;
typedef allocator_traits<allocator> alloc_traits;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::const_pointer const_pointer;
typedef typename alloc_traits::difference_type difference_type;
typedef typename alloc_traits::size_type size_type;
};
template<typename AugmentPolicy,typename Allocator>
@@ -131,7 +133,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<
@@ -227,7 +228,7 @@ struct ordered_index_node_impl_base:
#if !defined(BOOST_MULTI_INDEX_DISABLE_COMPRESSED_ORDERED_INDEX_NODES)
AugmentPolicy::template augmented_node<
mp11::mp_if_c<
typename mpl::if_c<
!(has_uintptr_type::value)||
(alignment_of<
ordered_index_node_compressed_base<AugmentPolicy,Allocator>
@@ -237,7 +238,7 @@ struct ordered_index_node_impl_base:
ordered_index_node_impl<AugmentPolicy,Allocator>*>::value),
ordered_index_node_std_base<AugmentPolicy,Allocator>,
ordered_index_node_compressed_base<AugmentPolicy,Allocator>
>
>::type
>::type
#else
AugmentPolicy::template augmented_node<
@@ -579,18 +580,18 @@ template<typename AugmentPolicy,typename Super>
struct ordered_index_node_trampoline:
ordered_index_node_impl<
AugmentPolicy,
allocator_rebind_t<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>
>::type
>
{
typedef ordered_index_node_impl<
AugmentPolicy,
allocator_rebind_t<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>
>::type
> impl_type;
};
@@ -609,14 +610,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 +648,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-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2014 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)
@@ -41,9 +41,8 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/function.hpp>
#include <boost/mpl/and.hpp>
#include <boost/multi_index/detail/promotes_arg.hpp>
#include <type_traits>
#include <utility>
namespace boost{
@@ -71,7 +70,7 @@ inline Node* ordered_index_find(
return ordered_index_find(
top,y,key,x,comp,
mp11::mp_and<
mpl::and_<
promotes_1st_arg<CompatibleCompare,CompatibleKey,key_type>,
promotes_2nd_arg<CompatibleCompare,key_type,CompatibleKey> >());
}
@@ -82,10 +81,10 @@ template<
>
inline Node* ordered_index_find(
Node* top,Node* y,const KeyFromValue& key,
const typename KeyFromValue::result_type& x,
const CompatibleCompare& comp,std::true_type)
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
{
return ordered_index_find(top,y,key,x,comp,std::false_type());
return ordered_index_find(top,y,key,x,comp,mpl::false_());
}
template<
@@ -94,7 +93,7 @@ template<
>
inline Node* ordered_index_find(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,std::false_type)
const CompatibleCompare& comp,mpl::false_)
{
Node* y0=y;
@@ -130,10 +129,10 @@ template<
>
inline Node* ordered_index_lower_bound(
Node* top,Node* y,const KeyFromValue& key,
const typename KeyFromValue::result_type& x,
const CompatibleCompare& comp,std::true_type)
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
{
return ordered_index_lower_bound(top,y,key,x,comp,std::false_type());
return ordered_index_lower_bound(top,y,key,x,comp,mpl::false_());
}
template<
@@ -142,7 +141,7 @@ template<
>
inline Node* ordered_index_lower_bound(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,std::false_type)
const CompatibleCompare& comp,mpl::false_)
{
while(top){
if(!comp(key(top->value()),x)){
@@ -176,10 +175,10 @@ template<
>
inline Node* ordered_index_upper_bound(
Node* top,Node* y,const KeyFromValue& key,
const typename KeyFromValue::result_type& x,
const CompatibleCompare& comp,std::true_type)
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
{
return ordered_index_upper_bound(top,y,key,x,comp,std::false_type());
return ordered_index_upper_bound(top,y,key,x,comp,mpl::false_());
}
template<
@@ -188,7 +187,7 @@ template<
>
inline Node* ordered_index_upper_bound(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,std::false_type)
const CompatibleCompare& comp,mpl::false_)
{
while(top){
if(comp(x,key(top->value()))){
@@ -213,7 +212,7 @@ inline std::pair<Node*,Node*> ordered_index_equal_range(
return ordered_index_equal_range(
top,y,key,x,comp,
mp11::mp_and<
mpl::and_<
promotes_1st_arg<CompatibleCompare,CompatibleKey,key_type>,
promotes_2nd_arg<CompatibleCompare,key_type,CompatibleKey> >());
}
@@ -224,10 +223,10 @@ template<
>
inline std::pair<Node*,Node*> ordered_index_equal_range(
Node* top,Node* y,const KeyFromValue& key,
const typename KeyFromValue::result_type& x,
const CompatibleCompare& comp,std::true_type)
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
{
return ordered_index_equal_range(top,y,key,x,comp,std::false_type());
return ordered_index_equal_range(top,y,key,x,comp,mpl::false_());
}
template<
@@ -236,7 +235,7 @@ template<
>
inline std::pair<Node*,Node*> ordered_index_equal_range(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,std::false_type)
const CompatibleCompare& comp,mpl::false_)
{
while(top){
if(comp(key(top->value()),x)){
@@ -249,9 +248,9 @@ inline std::pair<Node*,Node*> ordered_index_equal_range(
else{
return std::pair<Node*,Node*>(
ordered_index_lower_bound(
Node::from_impl(top->left()),top,key,x,comp,std::false_type()),
Node::from_impl(top->left()),top,key,x,comp,mpl::false_()),
ordered_index_upper_bound(
Node::from_impl(top->right()),y,key,x,comp,std::false_type()));
Node::from_impl(top->right()),y,key,x,comp,mpl::false_()));
}
}
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -15,7 +15,6 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/workaround.hpp>
#include <type_traits>
/* Metafunctions to check if f(arg1,arg2) promotes either arg1 to the type of
* arg2 or viceversa. By default, (i.e. if it cannot be determined), no
@@ -31,10 +30,10 @@ namespace multi_index{
namespace detail{
template<typename F,typename Arg1,typename Arg2>
struct promotes_1st_arg:std::false_type{};
struct promotes_1st_arg:mpl::false_{};
template<typename F,typename Arg1,typename Arg2>
struct promotes_2nd_arg:std::false_type{};
struct promotes_2nd_arg:mpl::false_{};
} /* namespace multi_index::detail */
@@ -44,7 +43,9 @@ struct promotes_2nd_arg:std::false_type{};
#else
#include <boost/mp11/function.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/not.hpp>
#include <boost/multi_index/detail/is_transparent.hpp>
#include <boost/type_traits/is_convertible.hpp>
@@ -56,8 +57,8 @@ namespace detail{
template<typename F,typename Arg1,typename Arg2>
struct promotes_1st_arg:
mp11::mp_and<
mp11::mp_not<is_transparent<F,Arg1,Arg2> >,
mpl::and_<
mpl::not_<is_transparent<F,Arg1,Arg2> >,
is_convertible<const Arg1,Arg2>,
is_transparent<F,Arg2,Arg2>
>
@@ -65,8 +66,8 @@ struct promotes_1st_arg:
template<typename F,typename Arg1,typename Arg2>
struct promotes_2nd_arg:
mp11::mp_and<
mp11::mp_not<is_transparent<F,Arg1,Arg2> >,
mpl::and_<
mpl::not_<is_transparent<F,Arg1,Arg2> >,
is_convertible<const Arg2,Arg1>,
is_transparent<F,Arg1,Arg1>
>
+6 -5
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2015 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,8 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <type_traits>
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost{
@@ -25,13 +26,13 @@ namespace detail{
/* gets the underlying pointer of a pointer-like value */
template<typename RawPointer>
inline RawPointer raw_ptr(RawPointer const& p,std::true_type)
inline RawPointer raw_ptr(RawPointer const& p,mpl::true_)
{
return p;
}
template<typename RawPointer,typename Pointer>
inline RawPointer raw_ptr(Pointer const& p,std::false_type)
inline RawPointer raw_ptr(Pointer const& p,mpl::false_)
{
return p==Pointer(0)?0:&*p;
}
@@ -39,7 +40,7 @@ inline RawPointer raw_ptr(Pointer const& p,std::false_type)
template<typename RawPointer,typename Pointer>
inline RawPointer raw_ptr(Pointer const& p)
{
return raw_ptr<RawPointer>(p,std::is_same<RawPointer,Pointer>());
return raw_ptr<RawPointer>(p,is_same<RawPointer,Pointer>());
}
} /* namespace multi_index::detail */
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2022 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,9 +14,9 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/allocator_access.hpp>
#include <algorithm>
#include <boost/core/noncopyable.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/auto_space.hpp>
#include <boost/multi_index/detail/rnd_index_ptr_array.hpp>
@@ -44,10 +44,10 @@ class random_access_index_loader_base:private noncopyable
{
protected:
typedef random_access_index_node_impl<
allocator_rebind_t<
typename rebind_alloc_for<
Allocator,
char
>
>::type
> node_impl_type;
typedef typename node_impl_type::pointer node_impl_pointer;
typedef random_access_index_ptr_array<Allocator> ptr_array;
@@ -93,7 +93,8 @@ protected:
}
private:
typedef allocator_size_type_t<Allocator> size_type;
typedef allocator_traits<Allocator> alloc_traits;
typedef typename alloc_traits::size_type size_type;
void preprocess()
{
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 Joaquin M Lopez Munoz.
/* Copyright 2003-2021 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,9 +14,9 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/allocator_access.hpp>
#include <algorithm>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
#include <cstddef>
#include <functional>
@@ -30,16 +30,18 @@ namespace detail{
template<typename Allocator>
struct random_access_index_node_impl
{
typedef allocator_rebind_t<
typedef typename rebind_alloc_for<
Allocator,random_access_index_node_impl
> node_allocator;
typedef allocator_pointer_t<node_allocator> pointer;
typedef allocator_const_pointer_t<node_allocator> const_pointer;
typedef allocator_difference_type_t<node_allocator> difference_type;
typedef allocator_rebind_t<
>::type node_allocator;
typedef allocator_traits<node_allocator> node_alloc_traits;
typedef typename node_alloc_traits::pointer pointer;
typedef typename node_alloc_traits::const_pointer const_pointer;
typedef typename node_alloc_traits::difference_type difference_type;
typedef typename rebind_alloc_for<
Allocator,pointer
> ptr_allocator;
typedef allocator_pointer_t<ptr_allocator> ptr_pointer;
>::type ptr_allocator;
typedef allocator_traits<ptr_allocator> ptr_alloc_traits;
typedef typename ptr_alloc_traits::pointer ptr_pointer;
ptr_pointer& up(){return up_;}
ptr_pointer up()const{return up_;}
@@ -193,17 +195,17 @@ private:
template<typename Super>
struct random_access_index_node_trampoline:
random_access_index_node_impl<
allocator_rebind_t<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>
>::type
>
{
typedef random_access_index_node_impl<
allocator_rebind_t<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>
>::type
> impl_type;
};
@@ -215,18 +217,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 +256,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-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2015 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)
@@ -83,7 +83,7 @@ template<typename Node,typename Allocator,typename Compare>
void random_access_index_inplace_merge(
const Allocator& al,
random_access_index_ptr_array<Allocator>& ptrs,
typename Node::impl_ptr_pointer first1,Compare comp)
BOOST_DEDUCED_TYPENAME Node::impl_ptr_pointer first1,Compare comp)
{
typedef typename Node::value_type value_type;
typedef typename Node::impl_pointer impl_pointer;
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2022 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,9 +14,9 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/allocator_access.hpp>
#include <algorithm>
#include <boost/core/noncopyable.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/auto_space.hpp>
#include <boost/multi_index/detail/rnd_index_node.hpp>
@@ -32,21 +32,20 @@ template<typename Allocator>
class random_access_index_ptr_array:private noncopyable
{
typedef random_access_index_node_impl<
allocator_rebind_t<
typename rebind_alloc_for<
Allocator,
char
>
>::type
> node_impl_type;
public:
typedef typename node_impl_type::pointer value_type;
typedef allocator_rebind_t<
typedef typename rebind_alloc_for<
Allocator,value_type
> value_allocator;
typedef allocator_pointer_t<
value_allocator> pointer;
typedef allocator_size_type_t<
value_allocator> size_type;
>::type value_allocator;
typedef allocator_traits<value_allocator> alloc_traits;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::size_type size_type;
random_access_index_ptr_array(
const Allocator& al,value_type end_,size_type sz):
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 Joaquin M Lopez Munoz.
/* Copyright 2003-2018 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,11 +14,11 @@
#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)
#include <boost/core/serialization.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/serialization/split_member.hpp>
#endif
namespace boost{
@@ -77,27 +77,23 @@ public:
* see explanation in safe_mode_iterator notes in safe_mode.hpp.
*/
template<class Archive>
void serialize(Archive& ar,const unsigned int version)
{
core::split_member(ar,*this,version);
}
BOOST_SERIALIZATION_SPLIT_MEMBER()
typedef typename Node::base_type node_base_type;
template<class Archive>
void save(Archive& ar,const unsigned int)const
{
node_base_type* bnode=get_node();
ar<<core::make_nvp("pointer",bnode);
node_base_type* bnode=node;
ar<<serialization::make_nvp("pointer",bnode);
}
template<class Archive>
void load(Archive& ar,const unsigned int)
{
node_base_type* bnode;
ar>>core::make_nvp("pointer",bnode);
node=typename Node::pointer(static_cast<Node*>(bnode));
ar>>serialization::make_nvp("pointer",bnode);
node=static_cast<Node*>(bnode);
}
#endif
@@ -105,10 +101,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-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2018 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -15,9 +15,8 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/pointer_traits.hpp>
#include <boost/mp11/function.hpp>
#include <boost/mpl/and.hpp>
#include <boost/multi_index/detail/promotes_arg.hpp>
#include <type_traits>
#include <utility>
namespace boost{
@@ -46,7 +45,7 @@ ranked_node_size(Pointer x)
template<typename Pointer>
inline Pointer ranked_index_nth(
typename ranked_node_size_type<Pointer>::type n,Pointer end_)
BOOST_DEDUCED_TYPENAME ranked_node_size_type<Pointer>::type n,Pointer end_)
{
typedef typename ranked_node_size_type<Pointer>::type size_type;
@@ -97,7 +96,7 @@ inline typename Node::size_type ranked_index_find_rank(
return ranked_index_find_rank(
top,y,key,x,comp,
mp11::mp_and<
mpl::and_<
promotes_1st_arg<CompatibleCompare,CompatibleKey,key_type>,
promotes_2nd_arg<CompatibleCompare,key_type,CompatibleKey> >());
}
@@ -108,10 +107,10 @@ template<
>
inline typename Node::size_type ranked_index_find_rank(
Node* top,Node* y,const KeyFromValue& key,
const typename KeyFromValue::result_type& x,
const CompatibleCompare& comp,std::true_type)
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
{
return ranked_index_find_rank(top,y,key,x,comp,std::false_type());
return ranked_index_find_rank(top,y,key,x,comp,mpl::false_());
}
template<
@@ -120,7 +119,7 @@ template<
>
inline typename Node::size_type ranked_index_find_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,std::false_type)
const CompatibleCompare& comp,mpl::false_)
{
typedef typename Node::size_type size_type;
@@ -163,10 +162,10 @@ template<
>
inline typename Node::size_type ranked_index_lower_bound_rank(
Node* top,Node* y,const KeyFromValue& key,
const typename KeyFromValue::result_type& x,
const CompatibleCompare& comp,std::true_type)
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
{
return ranked_index_lower_bound_rank(top,y,key,x,comp,std::false_type());
return ranked_index_lower_bound_rank(top,y,key,x,comp,mpl::false_());
}
template<
@@ -175,7 +174,7 @@ template<
>
inline typename Node::size_type ranked_index_lower_bound_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,std::false_type)
const CompatibleCompare& comp,mpl::false_)
{
typedef typename Node::size_type size_type;
@@ -216,10 +215,10 @@ template<
>
inline typename Node::size_type ranked_index_upper_bound_rank(
Node* top,Node* y,const KeyFromValue& key,
const typename KeyFromValue::result_type& x,
const CompatibleCompare& comp,std::true_type)
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
{
return ranked_index_upper_bound_rank(top,y,key,x,comp,std::false_type());
return ranked_index_upper_bound_rank(top,y,key,x,comp,mpl::false_());
}
template<
@@ -228,7 +227,7 @@ template<
>
inline typename Node::size_type ranked_index_upper_bound_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,std::false_type)
const CompatibleCompare& comp,mpl::false_)
{
typedef typename Node::size_type size_type;
@@ -261,7 +260,7 @@ ranked_index_equal_range_rank(
return ranked_index_equal_range_rank(
top,y,key,x,comp,
mp11::mp_and<
mpl::and_<
promotes_1st_arg<CompatibleCompare,CompatibleKey,key_type>,
promotes_2nd_arg<CompatibleCompare,key_type,CompatibleKey> >());
}
@@ -273,10 +272,10 @@ template<
inline std::pair<typename Node::size_type,typename Node::size_type>
ranked_index_equal_range_rank(
Node* top,Node* y,const KeyFromValue& key,
const typename KeyFromValue::result_type& x,
const CompatibleCompare& comp,std::true_type)
const BOOST_DEDUCED_TYPENAME KeyFromValue::result_type& x,
const CompatibleCompare& comp,mpl::true_)
{
return ranked_index_equal_range_rank(top,y,key,x,comp,std::false_type());
return ranked_index_equal_range_rank(top,y,key,x,comp,mpl::false_());
}
template<
@@ -286,11 +285,11 @@ template<
inline std::pair<typename Node::size_type,typename Node::size_type>
ranked_index_equal_range_rank(
Node* top,Node* y,const KeyFromValue& key,const CompatibleKey& x,
const CompatibleCompare& comp,std::false_type)
const CompatibleCompare& comp,mpl::false_)
{
typedef typename Node::size_type size_type;
if(!top)return std::pair<size_type,size_type>((size_type)0,(size_type)0);
if(!top)return std::pair<size_type,size_type>(0,0);
size_type s=top->impl()->size;
@@ -305,12 +304,12 @@ ranked_index_equal_range_rank(
}
else{
return std::pair<size_type,size_type>(
(size_type)(s-top->impl()->size+
s-top->impl()->size+
ranked_index_lower_bound_rank(
Node::from_impl(top->left()),top,key,x,comp,std::false_type())),
(size_type)(s-ranked_node_size(top->right())+
Node::from_impl(top->left()),top,key,x,comp,mpl::false_()),
s-ranked_node_size(top->right())+
ranked_index_upper_bound_rank(
Node::from_impl(top->right()),y,key,x,comp,std::false_type())));
Node::from_impl(top->right()),y,key,x,comp,mpl::false_()));
}
}while(top);
+15 -11
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2022 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)
@@ -119,18 +119,20 @@
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <algorithm>
#include <boost/core/addressof.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/core/noncopyable.hpp>
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/any_container_view.hpp>
#include <boost/multi_index/detail/iter_adaptor.hpp>
#include <boost/multi_index/safe_mode_errors.hpp>
#include <boost/type_traits/is_same.hpp>
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
#include <boost/core/serialization.hpp>
#include <boost/serialization/split_member.hpp>
#include <boost/serialization/version.hpp>
#endif
#if defined(BOOST_HAS_THREADS)
#include <boost/smart_ptr/detail/lightweight_mutex.hpp>
#include <boost/detail/lightweight_mutex.hpp>
#include <boost/multi_index/detail/scoped_bilock.hpp>
#endif
@@ -348,7 +350,9 @@ protected:
const safe_container_base* owner()const{return cont;}
private:
BOOST_MULTI_INDEX_PRIVATE_IF_MEMBER_TEMPLATE_FRIENDS:
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
friend class safe_container_base;
template<typename>
friend class safe_mode::safe_container;
@@ -357,6 +361,7 @@ private:
template<typename Dst,typename Iterator>
friend void safe_mode_detail::transfer_equivalent_iterators(
Dst&,Iterator,boost::true_type);
#endif
inline void attach(safe_container_base* cont_);
@@ -370,13 +375,16 @@ class safe_container_base:private noncopyable
public:
safe_container_base(){}
protected:
BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
friend class safe_iterator_base;
template<typename Iterator>
friend void safe_mode::detach_equivalent_iterators(Iterator&);
template<typename Dst,typename Iterator>
friend void safe_mode_detail::transfer_equivalent_iterators(
Dst&,Iterator,boost::true_type);
#endif
~safe_container_base()
{
@@ -548,11 +556,7 @@ private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive& ar,const unsigned int version)
{
core::split_member(ar,*this,version);
}
BOOST_SERIALIZATION_SPLIT_MEMBER()
template<class Archive>
void save(Archive& ar,const unsigned int version)const
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 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)
@@ -14,7 +14,7 @@
#endif
#include <boost/core/no_exceptions_support.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/mpl/if.hpp>
namespace boost{
@@ -120,7 +120,7 @@ struct null_guard : public scope_guard_impl_base
template< bool cond, class T >
struct null_guard_return
{
typedef mp11::mp_if_c<cond,T,null_guard> type;
typedef typename boost::mpl::if_c<cond,T,null_guard>::type type;
};
template<typename F>
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 Joaquin M Lopez Munoz.
/* Copyright 2003-2019 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,8 +14,8 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/allocator_access.hpp>
#include <algorithm>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/raw_ptr.hpp>
namespace boost{
@@ -29,14 +29,13 @@ namespace detail{
template<typename Allocator>
struct sequenced_index_node_impl
{
typedef allocator_rebind_t<
typedef typename rebind_alloc_for<
Allocator,sequenced_index_node_impl
> node_allocator;
typedef allocator_pointer_t<node_allocator> pointer;
typedef allocator_const_pointer_t<
node_allocator> const_pointer;
typedef allocator_difference_type_t<
node_allocator> difference_type;
>::type node_allocator;
typedef allocator_traits<node_allocator> alloc_traits;
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::const_pointer const_pointer;
typedef typename alloc_traits::difference_type difference_type;
pointer& prior(){return prior_;}
pointer prior()const{return prior_;}
@@ -133,17 +132,17 @@ private:
template<typename Super>
struct sequenced_index_node_trampoline:
sequenced_index_node_impl<
allocator_rebind_t<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>
>::type
>
{
typedef sequenced_index_node_impl<
allocator_rebind_t<
typename rebind_alloc_for<
typename Super::allocator_type,
char
>
>::type
> impl_type;
};
@@ -158,13 +157,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 +191,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);
}
};
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 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)
@@ -77,8 +77,8 @@ void sequenced_index_merge(SequencedIndex& x,SequencedIndex& y,Compare comp)
template<typename Node,typename Compare>
void sequenced_index_collate(
typename Node::impl_type* x,
typename Node::impl_type* y,
BOOST_DEDUCED_TYPENAME Node::impl_type* x,
BOOST_DEDUCED_TYPENAME Node::impl_type* y,
Compare comp)
{
typedef typename Node::impl_type impl_type;
@@ -1,4 +1,4 @@
/* Copyright 2003-2023 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,7 +14,8 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/serialization.hpp>
#include <boost/serialization/split_member.hpp>
#include <boost/serialization/version.hpp>
namespace boost{
@@ -41,11 +42,7 @@ struct serialization_version
private:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive& ar,const unsigned int version)
{
core::split_member(ar,*this,version);
}
BOOST_SERIALIZATION_SPLIT_MEMBER()
template<class Archive>
void save(Archive&,const unsigned int)const{}
@@ -1,62 +0,0 @@
/* 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)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_TYPE_LIST_HPP
#define BOOST_MULTI_INDEX_DETAIL_TYPE_LIST_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#if defined(BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT)
#define BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER \
<boost/mpl/push_front.hpp>
#include BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#undef BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#define BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER \
<boost/mpl/vector.hpp>
#include BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#undef BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
namespace boost{
namespace multi_index{
namespace detail{
using empty_type_list=mpl::vector0<>;
template<typename TypeList,typename T>
using type_list_push_front=typename mpl::push_front<TypeList,T>::type;
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#else
#include <boost/mp11/list.hpp>
namespace boost{
namespace multi_index{
namespace detail{
using empty_type_list=mp11::mp_list<>;
template<typename TypeList,typename T>
using type_list_push_front=mp11::mp_push_front<TypeList,T>;
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif
#endif
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,7 +14,7 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/mp11/integral.hpp>
#include <boost/mpl/bool.hpp>
namespace boost{
@@ -64,8 +64,8 @@ struct uintptr_aux
typedef uintptr_candidates<index>::type type;
};
typedef mp11::mp_bool<uintptr_aux::has_uintptr_type> has_uintptr_type;
typedef uintptr_aux::type uintptr_type;
typedef mpl::bool_<uintptr_aux::has_uintptr_type> has_uintptr_type;
typedef uintptr_aux::type uintptr_type;
} /* namespace multi_index::detail */
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,6 +14,7 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/detail/workaround.hpp>
namespace boost{
@@ -0,0 +1,247 @@
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org/libs/multi_index for library home page.
*/
#ifndef BOOST_MULTI_INDEX_DETAIL_VARTEMPL_SUPPORT_HPP
#define BOOST_MULTI_INDEX_DETAIL_VARTEMPL_SUPPORT_HPP
#if defined(_MSC_VER)
#pragma once
#endif
/* Utilities for emulation of variadic template functions. Variadic packs are
* replaced by lists of BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS parameters:
*
* - typename... Args --> BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK
* - Args&&... args --> BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK
* - std::forward<Args>(args)... --> BOOST_MULTI_INDEX_FORWARD_PARAM_PACK
*
* Forwarding emulated with Boost.Move. A template functions foo_imp
* defined in such way accepts *exactly* BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS
* arguments: variable number of arguments is emulated by providing a set of
* overloads foo forwarding to foo_impl with
*
* BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL
* BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG (initial extra arg)
*
* which fill the extra args with boost::multi_index::detail::noarg's.
* boost::multi_index::detail::vartempl_placement_new works the opposite
* way: it acceps a full a pointer x to Value and a
* BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK and forwards to
* new(x) Value(args) where args is the argument pack after discarding
* noarg's.
*
* Emulation decays to the real thing when the compiler supports variadic
* templates and move semantics natively.
*/
#include <boost/config.hpp>
#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES)||\
defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
#include <boost/move/core.hpp>
#include <boost/move/utility.hpp>
#include <boost/preprocessor/arithmetic/add.hpp>
#include <boost/preprocessor/arithmetic/sub.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#include <boost/preprocessor/facilities/intercept.hpp>
#include <boost/preprocessor/logical/and.hpp>
#include <boost/preprocessor/punctuation/comma.hpp>
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
#include <boost/preprocessor/seq/elem.hpp>
#if !defined(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS)
#define BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS 5
#endif
#define BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK \
BOOST_PP_ENUM_PARAMS( \
BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,typename T)
#define BOOST_MULTI_INDEX_VARTEMPL_ARG(z,n,_) \
BOOST_FWD_REF(BOOST_PP_CAT(T,n)) BOOST_PP_CAT(t,n)
#define BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK \
BOOST_PP_ENUM( \
BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS, \
BOOST_MULTI_INDEX_VARTEMPL_ARG,~)
#define BOOST_MULTI_INDEX_VARTEMPL_FORWARD_ARG(z,n,_) \
boost::forward<BOOST_PP_CAT(T,n)>(BOOST_PP_CAT(t,n))
#define BOOST_MULTI_INDEX_FORWARD_PARAM_PACK \
BOOST_PP_ENUM( \
BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS, \
BOOST_MULTI_INDEX_VARTEMPL_FORWARD_ARG,~)
namespace boost{namespace multi_index{namespace detail{
struct noarg{};
}}}
/* call vartempl function without args */
#define BOOST_MULTI_INDEX_NULL_PARAM_PACK \
BOOST_PP_ENUM_PARAMS( \
BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS, \
boost::multi_index::detail::noarg() BOOST_PP_INTERCEPT)
#define BOOST_MULTI_INDEX_TEMPLATE_N(n) \
template<BOOST_PP_ENUM_PARAMS(n,typename T)>
#define BOOST_MULTI_INDEX_TEMPLATE_0(n)
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_AUX(z,n,data) \
BOOST_PP_IF(n, \
BOOST_MULTI_INDEX_TEMPLATE_N, \
BOOST_MULTI_INDEX_TEMPLATE_0)(n) \
BOOST_PP_SEQ_ELEM(0,data) /* ret */ \
BOOST_PP_SEQ_ELEM(1,data) /* name_from */ ( \
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_ARG,~)) \
{ \
return BOOST_PP_SEQ_ELEM(2,data) /* name_to */ ( \
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_FORWARD_ARG,~) \
BOOST_PP_COMMA_IF( \
BOOST_PP_AND( \
n,BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n))) \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n), \
boost::multi_index::detail::noarg() BOOST_PP_INTERCEPT) \
); \
}
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL( \
ret,name_from,name_to) \
BOOST_PP_REPEAT_FROM_TO( \
0,BOOST_PP_ADD(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,1), \
BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_AUX, \
(ret)(name_from)(name_to))
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG_AUX( \
z,n,data) \
BOOST_PP_IF(n, \
BOOST_MULTI_INDEX_TEMPLATE_N, \
BOOST_MULTI_INDEX_TEMPLATE_0)(n) \
BOOST_PP_SEQ_ELEM(0,data) /* ret */ \
BOOST_PP_SEQ_ELEM(1,data) /* name_from */ ( \
BOOST_PP_SEQ_ELEM(3,data) BOOST_PP_SEQ_ELEM(4,data) /* extra arg */\
BOOST_PP_COMMA_IF(n) \
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_ARG,~)) \
{ \
return BOOST_PP_SEQ_ELEM(2,data) /* name_to */ ( \
BOOST_PP_SEQ_ELEM(4,data) /* extra_arg_name */ \
BOOST_PP_COMMA_IF(n) \
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_FORWARD_ARG,~) \
BOOST_PP_COMMA_IF( \
BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n)) \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n), \
boost::multi_index::detail::noarg() BOOST_PP_INTERCEPT) \
); \
}
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG( \
ret,name_from,name_to,extra_arg_type,extra_arg_name) \
BOOST_PP_REPEAT_FROM_TO( \
0,BOOST_PP_ADD(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,1), \
BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG_AUX, \
(ret)(name_from)(name_to)(extra_arg_type)(extra_arg_name))
namespace boost{
namespace multi_index{
namespace detail{
#define BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW_AUX(z,n,name) \
template< \
typename Value \
BOOST_PP_COMMA_IF(n) \
BOOST_PP_ENUM_PARAMS(n,typename T) \
> \
Value* name( \
Value* x \
BOOST_PP_COMMA_IF(n) \
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_ARG,~) \
BOOST_PP_COMMA_IF( \
BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n)) \
BOOST_PP_ENUM_PARAMS( \
BOOST_PP_SUB(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,n), \
BOOST_FWD_REF(noarg) BOOST_PP_INTERCEPT)) \
{ \
return new(x) Value( \
BOOST_PP_ENUM(n,BOOST_MULTI_INDEX_VARTEMPL_FORWARD_ARG,~)); \
}
#define BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW(name) \
BOOST_PP_REPEAT_FROM_TO( \
0,BOOST_PP_ADD(BOOST_MULTI_INDEX_LIMIT_VARTEMPL_ARGS,1), \
BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW_AUX, \
name)
BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW(vartempl_placement_new)
#undef BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW_AUX
#undef BOOST_MULTI_INDEX_VARTEMPL_TO_PLACEMENT_NEW
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#else
/* native variadic templates support */
#include <utility>
#define BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK typename... Args
#define BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK Args&&... args
#define BOOST_MULTI_INDEX_FORWARD_PARAM_PACK std::forward<Args>(args)...
#define BOOST_MULTI_INDEX_NULL_PARAM_PACK
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL( \
ret,name_from,name_to) \
template<typename... Args> ret name_from(Args&&... args) \
{ \
return name_to(std::forward<Args>(args)...); \
}
#define BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG( \
ret,name_from,name_to,extra_arg_type,extra_arg_name) \
template<typename... Args> ret name_from( \
extra_arg_type extra_arg_name,Args&&... args) \
{ \
return name_to(extra_arg_name,std::forward<Args>(args)...); \
}
namespace boost{
namespace multi_index{
namespace detail{
template<typename Value,typename... Args>
Value* vartempl_placement_new(Value*x,Args&&... args)
{
return new(x) Value(std::forward<Args>(args)...);
}
} /* namespace multi_index::detail */
} /* namespace multi_index */
} /* namespace boost */
#endif
#endif
+28 -10
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2015 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,14 +14,17 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
#include <boost/core/enable_if.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/mpl/if.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/is_reference.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/type_traits/remove_reference.hpp>
#include <boost/utility/enable_if.hpp>
#if !defined(BOOST_NO_SFINAE)
#include <boost/type_traits/is_convertible.hpp>
#endif
namespace boost{
@@ -51,8 +54,13 @@ struct const_ref_global_fun_base
template<typename ChainedPtr>
#if !defined(BOOST_NO_SFINAE)
typename disable_if<
is_convertible<const ChainedPtr&,Value>,Type>::type
#else
Type
#endif
operator()(const ChainedPtr& x)const
{
return operator()(*x);
@@ -93,8 +101,13 @@ struct non_const_ref_global_fun_base
template<typename ChainedPtr>
#if !defined(BOOST_NO_SFINAE)
typename disable_if<
is_convertible<ChainedPtr&,Value>,Type>::type
#else
Type
#endif
operator()(const ChainedPtr& x)const
{
return operator()(*x);
@@ -120,8 +133,13 @@ struct non_ref_global_fun_base
template<typename ChainedPtr>
#if !defined(BOOST_NO_SFINAE)
typename disable_if<
is_convertible<const ChainedPtr&,const Value&>,Type>::type
#else
Type
#endif
operator()(const ChainedPtr& x)const
{
return operator()(*x);
@@ -148,15 +166,15 @@ struct non_ref_global_fun_base
template<class Value,typename Type,Type (*PtrToFunction)(Value)>
struct global_fun:
mp11::mp_if<
is_reference<Value>,
typename mp11::mp_if<
is_const<typename remove_reference<Value>::type>,
mpl::if_c<
is_reference<Value>::value,
typename mpl::if_c<
is_const<typename remove_reference<Value>::type>::value,
detail::const_ref_global_fun_base<Value,Type,PtrToFunction>,
detail::non_const_ref_global_fun_base<Value,Type,PtrToFunction>
>,
>::type,
detail::non_ref_global_fun_base<Value,Type,PtrToFunction>
>
>::type
{
};
+131 -98
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2026 Joaquin M Lopez Munoz.
/* Copyright 2003-2021 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)
@@ -17,11 +17,18 @@
#include <algorithm>
#include <boost/call_traits.hpp>
#include <boost/core/addressof.hpp>
#include <boost/core/allocator_access.hpp>
#include <boost/core/no_exceptions_support.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/foreach_fwd.hpp>
#include <boost/limits.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/move/core.hpp>
#include <boost/move/utility_core.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/push_front.hpp>
#include <boost/multi_index/detail/access_specifier.hpp>
#include <boost/multi_index/detail/adl_swap.hpp>
#include <boost/multi_index/detail/allocator_traits.hpp>
#include <boost/multi_index/detail/auto_space.hpp>
#include <boost/multi_index/detail/bucket_array.hpp>
#include <boost/multi_index/detail/do_not_copy_elements_tag.hpp>
@@ -33,20 +40,22 @@
#include <boost/multi_index/detail/promotes_arg.hpp>
#include <boost/multi_index/detail/safe_mode.hpp>
#include <boost/multi_index/detail/scope_guard.hpp>
#include <boost/multi_index/detail/type_list.hpp>
#include <boost/multi_index/detail/vartempl_support.hpp>
#include <boost/multi_index/hashed_index_fwd.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/type_traits/is_same.hpp>
#include <cmath>
#include <cstddef>
#include <functional>
#include <initializer_list>
#include <iterator>
#include <type_traits>
#include <utility>
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
#include <initializer_list>
#endif
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
#include <boost/core/serialization.hpp>
#include <boost/serialization/nvp.hpp>
#endif
#if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING)
@@ -83,10 +92,24 @@ template<
typename KeyFromValue,typename Hash,typename Pred,
typename SuperMeta,typename TagList,typename Category
>
class hashed_index:protected SuperMeta::type
class hashed_index:
BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS SuperMeta::type
{
#if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING)&&\
BOOST_WORKAROUND(__MWERKS__,<=0x3003)
/* The "ISO C++ Template Parser" option in CW8.3 has a problem with the
* lifetime of const references bound to temporaries --precisely what
* scopeguards are.
*/
#pragma parse_mfunc_templ off
#endif
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
/* cross-index access */
template <typename,typename,typename> friend class index_base;
#endif
typedef typename SuperMeta::type super;
@@ -112,14 +135,17 @@ public:
typedef Hash hasher;
typedef Pred key_equal;
typedef typename super::final_allocator_type allocator_type;
typedef allocator_pointer_t<allocator_type> pointer;
typedef allocator_const_pointer_t<
allocator_type> const_pointer;
private:
typedef allocator_traits<allocator_type> alloc_traits;
public:
typedef typename alloc_traits::pointer pointer;
typedef typename alloc_traits::const_pointer const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef allocator_size_type_t<allocator_type> size_type;
typedef allocator_difference_type_t<
allocator_type> difference_type;
typedef typename alloc_traits::size_type size_type;
typedef typename alloc_traits::difference_type difference_type;
typedef tuple<size_type,
key_from_value,hasher,key_equal> ctor_args;
@@ -152,15 +178,15 @@ protected:
typedef tuples::cons<
ctor_args,
typename super::ctor_args_list> ctor_args_list;
typedef type_list_push_front<
typedef typename mpl::push_front<
typename super::index_type_list,
hashed_index> index_type_list;
typedef type_list_push_front<
hashed_index>::type index_type_list;
typedef typename mpl::push_front<
typename super::iterator_type_list,
iterator> iterator_type_list;
typedef type_list_push_front<
iterator>::type iterator_type_list;
typedef typename mpl::push_front<
typename super::const_iterator_type_list,
const_iterator> const_iterator_type_list;
const_iterator>::type const_iterator_type_list;
typedef typename super::copy_map_type copy_map_type;
#if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)
@@ -195,12 +221,14 @@ public:
return *this;
}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
hashed_index<KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>& operator=(
std::initializer_list<value_type> list)
{
this->final()=list;
return *this;
}
#endif
allocator_type get_allocator()const BOOST_NOEXCEPT
{
@@ -246,27 +274,11 @@ public:
/* modifiers */
template<typename...Args>
std::pair<iterator,bool> emplace(Args&&... args)
{
BOOST_MULTI_INDEX_HASHED_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool>p=
this->final_emplace_(std::forward<Args>(args)...);
return std::pair<iterator,bool>(make_iterator(p.first),p.second);
}
BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL(
pair_return_type,emplace,emplace_impl)
template<typename...Args>
iterator emplace_hint(iterator position,Args&&... args)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_IS_OWNER(position,*this);
BOOST_MULTI_INDEX_HASHED_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool>p=
this->final_emplace_hint_(
static_cast<final_node_type*>(position.get_node()),
std::forward<Args>(args)...);
return make_iterator(p.first);
}
BOOST_MULTI_INDEX_OVERLOADS_TO_VARTEMPL_EXTRA_ARG(
iterator,emplace_hint,emplace_hint_impl,iterator,position)
std::pair<iterator,bool> insert(const value_type& x)
{
@@ -275,7 +287,7 @@ public:
return std::pair<iterator,bool>(make_iterator(p.first),p.second);
}
std::pair<iterator,bool> insert(value_type&& x)
std::pair<iterator,bool> insert(BOOST_RV_REF(value_type) x)
{
BOOST_MULTI_INDEX_HASHED_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool> p=this->final_insert_rv_(x);
@@ -292,7 +304,7 @@ public:
return make_iterator(p.first);
}
iterator insert(iterator position,value_type&& x)
iterator insert(iterator position,BOOST_RV_REF(value_type) x)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_IS_OWNER(position,*this);
@@ -309,20 +321,22 @@ public:
for(;first!=last;++first)this->final_insert_ref_(*first);
}
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
void insert(std::initializer_list<value_type> list)
{
insert(list.begin(),list.end());
}
#endif
insert_return_type insert(node_type&& nh)
insert_return_type insert(BOOST_RV_REF(node_type) nh)
{
if(nh)BOOST_MULTI_INDEX_CHECK_EQUAL_ALLOCATORS(*this,nh);
BOOST_MULTI_INDEX_HASHED_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool> p=this->final_insert_nh_(nh);
return insert_return_type(make_iterator(p.first),p.second,std::move(nh));
return insert_return_type(make_iterator(p.first),p.second,boost::move(nh));
}
iterator insert(const_iterator position,node_type&& nh)
iterator insert(const_iterator position,BOOST_RV_REF(node_type) nh)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_IS_OWNER(position,*this);
@@ -407,7 +421,7 @@ public:
x,static_cast<final_node_type*>(position.get_node()));
}
bool replace(iterator position,value_type&& x)
bool replace(iterator position,BOOST_RV_REF(value_type) x)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(position);
@@ -505,11 +519,11 @@ public:
template<typename Index>
BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(hashed_index,Index,void)
merge(Index&& x){merge(static_cast<Index&>(x));}
merge(BOOST_RV_REF(Index) x){merge(static_cast<Index&>(x));}
template<typename Index>
BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(hashed_index,Index,pair_return_type)
merge(Index& x,typename Index::iterator i)
merge(Index& x,BOOST_DEDUCED_TYPENAME Index::iterator i)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(i);
BOOST_MULTI_INDEX_CHECK_DEREFERENCEABLE_ITERATOR(i);
@@ -529,7 +543,7 @@ public:
template<typename Index>
BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(hashed_index,Index,pair_return_type)
merge(Index&& x,typename Index::iterator i)
merge(BOOST_RV_REF(Index) x,BOOST_DEDUCED_TYPENAME Index::iterator i)
{
return merge(static_cast<Index&>(x),i);
}
@@ -538,8 +552,8 @@ public:
BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(hashed_index,Index,void)
merge(
Index& x,
typename Index::iterator first,
typename Index::iterator last)
BOOST_DEDUCED_TYPENAME Index::iterator first,
BOOST_DEDUCED_TYPENAME Index::iterator last)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(first);
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(last);
@@ -556,9 +570,9 @@ public:
template<typename Index>
BOOST_MULTI_INDEX_ENABLE_IF_MERGEABLE(hashed_index,Index,void)
merge(
Index&& x,
typename Index::iterator first,
typename Index::iterator last)
BOOST_RV_REF(Index) x,
BOOST_DEDUCED_TYPENAME Index::iterator first,
BOOST_DEDUCED_TYPENAME Index::iterator last)
{
merge(static_cast<Index&>(x),first,last);
}
@@ -734,15 +748,13 @@ public:
rehash(static_cast<size_type>(std::ceil(static_cast<float>(n)/mlf)));
}
protected:
hashed_index(
const ctor_args_list& args_list,
const allocator_type& al,index_node_type* h):
super(args_list.get_tail(),al,h),
BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS:
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 +766,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 +787,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)
@@ -1169,9 +1179,13 @@ protected:
/* comparison */
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
/* defect macro refers to class, not function, templates, but anyway */
template<typename K,typename H,typename P,typename S,typename T,typename C>
friend bool operator==(
const hashed_index<K,H,P,S,T,C>&,const hashed_index<K,H,P,S,T,C>& y);
#endif
bool equals(const hashed_index& x)const{return equals(x,Category());}
@@ -1224,14 +1238,14 @@ protected:
void save_(
Archive& ar,const unsigned int version,const index_saver_type& sm)const
{
ar<<core::make_nvp("position",buckets);
ar<<serialization::make_nvp("position",buckets);
super::save_(ar,version,sm);
}
template<typename Archive>
void load_(Archive& ar,const unsigned int version,const index_loader_type& lm)
{
ar>>core::make_nvp("position",buckets);
ar>>serialization::make_nvp("position",buckets);
super::load_(ar,version,lm);
}
#endif
@@ -1290,11 +1304,11 @@ private:
node_impl_base_pointer first,last;
};
typedef mp11::mp_if<
typedef typename mpl::if_<
is_same<Category,hashed_unique_tag>,
node_impl_base_pointer,
link_info_non_unique
> link_info;
>::type link_info;
bool link_point(value_param_type v,link_info& pos)
{
@@ -1436,11 +1450,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);
}
}
@@ -1650,14 +1660,37 @@ private:
}
#endif
template<BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK>
std::pair<iterator,bool> emplace_impl(BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
{
BOOST_MULTI_INDEX_HASHED_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool>p=
this->final_emplace_(BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
return std::pair<iterator,bool>(make_iterator(p.first),p.second);
}
template<BOOST_MULTI_INDEX_TEMPLATE_PARAM_PACK>
iterator emplace_hint_impl(
iterator position,BOOST_MULTI_INDEX_FUNCTION_PARAM_PACK)
{
BOOST_MULTI_INDEX_CHECK_VALID_ITERATOR(position);
BOOST_MULTI_INDEX_CHECK_IS_OWNER(position,*this);
BOOST_MULTI_INDEX_HASHED_INDEX_CHECK_INVARIANT;
std::pair<final_node_type*,bool>p=
this->final_emplace_hint_(
static_cast<final_node_type*>(position.get_node()),
BOOST_MULTI_INDEX_FORWARD_PARAM_PACK);
return make_iterator(p.first);
}
template<
typename CompatibleHash,typename CompatiblePred
>
iterator find(
const key_type& k,
const CompatibleHash& hash,const CompatiblePred& eq,std::true_type)const
const CompatibleHash& hash,const CompatiblePred& eq,mpl::true_)const
{
return find(k,hash,eq,std::false_type());
return find(k,hash,eq,mpl::false_());
}
template<
@@ -1665,7 +1698,7 @@ private:
>
iterator find(
const CompatibleKey& k,
const CompatibleHash& hash,const CompatiblePred& eq,std::false_type)const
const CompatibleHash& hash,const CompatiblePred& eq,mpl::false_)const
{
std::size_t buc=buckets.position(hash(k));
for(node_impl_pointer x=buckets.at(buc)->prior();
@@ -1682,9 +1715,9 @@ private:
>
size_type count(
const key_type& k,
const CompatibleHash& hash,const CompatiblePred& eq,std::true_type)const
const CompatibleHash& hash,const CompatiblePred& eq,mpl::true_)const
{
return count(k,hash,eq,std::false_type());
return count(k,hash,eq,mpl::false_());
}
template<
@@ -1692,7 +1725,7 @@ private:
>
size_type count(
const CompatibleKey& k,
const CompatibleHash& hash,const CompatiblePred& eq,std::false_type)const
const CompatibleHash& hash,const CompatiblePred& eq,mpl::false_)const
{
std::size_t buc=buckets.position(hash(k));
for(node_impl_pointer x=buckets.at(buc)->prior();
@@ -1715,9 +1748,9 @@ private:
>
std::pair<iterator,iterator> equal_range(
const key_type& k,
const CompatibleHash& hash,const CompatiblePred& eq,std::true_type)const
const CompatibleHash& hash,const CompatiblePred& eq,mpl::true_)const
{
return equal_range(k,hash,eq,std::false_type());
return equal_range(k,hash,eq,mpl::false_());
}
template<
@@ -1725,7 +1758,7 @@ private:
>
std::pair<iterator,iterator> equal_range(
const CompatibleKey& k,
const CompatibleHash& hash,const CompatiblePred& eq,std::false_type)const
const CompatibleHash& hash,const CompatiblePred& eq,mpl::false_)const
{
std::size_t buc=buckets.position(hash(k));
for(node_impl_pointer x=buckets.at(buc)->prior();
@@ -1749,6 +1782,11 @@ private:
#if defined(BOOST_MULTI_INDEX_ENABLE_SAFE_MODE)
safe_container safe;
#endif
#if defined(BOOST_MULTI_INDEX_ENABLE_INVARIANT_CHECKING)&&\
BOOST_WORKAROUND(__MWERKS__,<=0x3003)
#pragma parse_mfunc_templ reset
#endif
};
#if defined(BOOST_MSVC)
@@ -1801,7 +1839,7 @@ struct hashed_unique
{
typedef typename detail::hashed_index_args<
Arg1,Arg2,Arg3,Arg4> index_args;
typedef typename index_args::tag_list_type tag_list_type;
typedef typename index_args::tag_list_type::type tag_list_type;
typedef typename index_args::key_from_value_type key_from_value_type;
typedef typename index_args::hash_type hash_type;
typedef typename index_args::pred_type pred_type;
@@ -1826,7 +1864,7 @@ struct hashed_non_unique
{
typedef typename detail::hashed_index_args<
Arg1,Arg2,Arg3,Arg4> index_args;
typedef typename index_args::tag_list_type tag_list_type;
typedef typename index_args::tag_list_type::type tag_list_type;
typedef typename index_args::key_from_value_type key_from_value_type;
typedef typename index_args::hash_type hash_type;
typedef typename index_args::pred_type pred_type;
@@ -1852,21 +1890,16 @@ struct hashed_non_unique
/* Boost.Foreach compatibility */
namespace boost{
namespace foreach{
template<typename>
struct is_noncopyable;
template<
typename KeyFromValue,typename Hash,typename Pred,
typename SuperMeta,typename TagList,typename Category
>
struct is_noncopyable<boost::multi_index::detail::hashed_index<
KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>
>:std::true_type{};
}
inline boost::mpl::true_* boost_foreach_is_noncopyable(
boost::multi_index::detail::hashed_index<
KeyFromValue,Hash,Pred,SuperMeta,TagList,Category>*&,
boost_foreach_argument_dependent_lookup_hack)
{
return 0;
}
#undef BOOST_MULTI_INDEX_HASHED_INDEX_CHECK_INVARIANT
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -56,14 +56,14 @@ void swap(
/* hashed_index specifiers */
template<
typename Arg1,typename Arg2=void,
typename Arg3=void,typename Arg4=void
typename Arg1,typename Arg2=mpl::na,
typename Arg3=mpl::na,typename Arg4=mpl::na
>
struct hashed_unique;
template<
typename Arg1,typename Arg2=void,
typename Arg3=void,typename Arg4=void
typename Arg1,typename Arg2=mpl::na,
typename Arg3=mpl::na,typename Arg4=mpl::na
>
struct hashed_non_unique;
+20 -7
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2015 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,13 +14,16 @@
#endif
#include <boost/config.hpp>
#include <boost/core/enable_if.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mp11/utility.hpp>
#include <boost/mpl/if.hpp>
#include <boost/multi_index/identity_fwd.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/remove_const.hpp>
#include <boost/utility/enable_if.hpp>
#if !defined(BOOST_NO_SFINAE)
#include <boost/type_traits/is_convertible.hpp>
#endif
namespace boost{
@@ -47,7 +50,12 @@ struct const_identity_base
template<typename ChainedPtr>
#if !defined(BOOST_NO_SFINAE)
typename disable_if<is_convertible<const ChainedPtr&,Type&>,Type&>::type
#else
Type&
#endif
operator()(const ChainedPtr& x)const
{
return operator()(*x);
@@ -86,8 +94,13 @@ struct non_const_identity_base
template<typename ChainedPtr>
#if !defined(BOOST_NO_SFINAE)
typename disable_if<
is_convertible<const ChainedPtr&,const Type&>,Type&>::type
#else
Type&
#endif
operator()(const ChainedPtr& x)const
{
return operator()(*x);
@@ -118,10 +131,10 @@ struct non_const_identity_base
template<class Type>
struct identity:
mp11::mp_if<
is_const<Type>,
mpl::if_c<
is_const<Type>::value,
detail::const_identity_base<Type>,detail::non_const_identity_base<Type>
>
>::type
{
};
+7 -24
View File
@@ -1,4 +1,4 @@
/* Copyright 2003-2025 Joaquin M Lopez Munoz.
/* Copyright 2003-2013 Joaquin M Lopez Munoz.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
@@ -14,23 +14,17 @@
#endif
#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
/* An Mp11 list containing the index specifiers for instantiation
* of a multi_index_container.
* If BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT is defined, the old
* MPL-based definition of indexed_by is kept.
*/
#if defined(BOOST_MULTI_INDEX_ENABLE_MPL_SUPPORT)
#define BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER \
<boost/mpl/vector.hpp>
#include BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#undef BOOST_MULTI_INDEX_BLOCK_BOOSTDEP_HEADER
#include <boost/mpl/vector.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/control/expr_if.hpp>
#include <boost/preprocessor/repetition/enum.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
/* An alias to mpl::vector used to hide MPL from the user.
* indexed_by contains the index specifiers for instantiation
* of a multi_index_container.
*/
/* This user_definable macro limits the number of elements of an index list;
* useful for shortening resulting symbol names (MSVC++ 6.0, for instance,
* has problems coping with very long symbol names.)
@@ -70,16 +64,5 @@ struct indexed_by:
#undef BOOST_MULTI_INDEX_INDEXED_BY_TEMPLATE_PARM
#undef BOOST_MULTI_INDEX_INDEXED_BY_SIZE
#else
namespace boost{
namespace multi_index{
template<typename T,typename... Ts>
struct indexed_by;
} /* namespace multi_index */
} /* namespace boost */
#endif
#endif

Some files were not shown because too many files have changed in this diff Show More