forked from boostorg/function
Compare commits
102 Commits
feature/re
...
boost-1.87
Author | SHA1 | Date | |
---|---|---|---|
89dfb032f2 | |||
ac731c96bb | |||
f3a164eaeb | |||
620c01266f | |||
e46566bc89 | |||
bd668a0d9c | |||
bc78cd0f3d | |||
27bbedd3a1 | |||
55567d8128 | |||
7e4d90c87d | |||
b4ce38b1a0 | |||
e198ea3bc1 | |||
0daa9f439e | |||
edd5bc27ed | |||
b397ad461e | |||
92b9a12c67 | |||
98ae625d5b | |||
1204b7d200 | |||
a39d5404d6 | |||
c7ca5cc828 | |||
d9647610ff | |||
96e26bb93e | |||
bd181fdf89 | |||
9788bb6cea | |||
694b253086 | |||
35f0c2a681 | |||
4f89a283fd | |||
38a2ab7646 | |||
b2fdb20690 | |||
13407f5e3e | |||
7248975133 | |||
28b88d07bb | |||
e51f941dd4 | |||
483504c615 | |||
7350f9b354 | |||
3b48732773 | |||
6876969bfc | |||
88da3c6568 | |||
50ac0b74c9 | |||
6de542f1bc | |||
1e3d469155 | |||
0601af0be4 | |||
a46646ecaa | |||
8ce457b161 | |||
a3249ce5db | |||
fa845b2fe3 | |||
bf2b23d40f | |||
52ff7423b7 | |||
5b5b2de461 | |||
916b44374d | |||
87d8b29dc0 | |||
7efb3be043 | |||
691b765827 | |||
7b8bdda461 | |||
3380fc642f | |||
b241c83d43 | |||
4cedf0bf3b | |||
692cf3d56e | |||
15a4f89d9c | |||
5803badc20 | |||
4ba8c23ce4 | |||
4e6dda7364 | |||
b13f8f6f20 | |||
af8e66d03b | |||
f898d3a1dd | |||
a9a0f90bc2 | |||
c9357b6819 | |||
3254a3857a | |||
2570672623 | |||
ee600cf665 | |||
8d7f2ed1a5 | |||
509de96a1c | |||
eff07e72c3 | |||
18e8bf458c | |||
f86ddb0bb9 | |||
72889d5a01 | |||
97decbc7af | |||
dadff43639 | |||
c423753491 | |||
86b7a7809a | |||
835e95f82f | |||
42a16b084c | |||
af53f1b672 | |||
c96f9d68b4 | |||
3182d502eb | |||
d56678401d | |||
b3905c7394 | |||
1f3f971d1f | |||
6eddcae095 | |||
a6605b5d0b | |||
8b126c8950 | |||
7ca2310b15 | |||
4ecf3e8ad5 | |||
4d3b477d71 | |||
a8ae69798d | |||
65bbbbc359 | |||
f1535c3b00 | |||
141b4331e4 | |||
69eae72f9b | |||
d268283044 | |||
361e07808f | |||
45e1ddeabc |
183
.drone.jsonnet
183
.drone.jsonnet
@ -32,6 +32,8 @@ local linux_pipeline(name, image, environment, packages = "", sources = [], arch
|
||||
commands:
|
||||
[
|
||||
'set -e',
|
||||
'uname -a',
|
||||
'echo $DRONE_STAGE_MACHINE',
|
||||
'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 []) +
|
||||
@ -97,269 +99,300 @@ local windows_pipeline(name, image, environment, arch = "amd64") =
|
||||
|
||||
[
|
||||
linux_pipeline(
|
||||
"Linux 14.04 GCC 4.4",
|
||||
"cppalliance/droneubuntu1404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-4.4', CXXSTD: '98,0x' },
|
||||
"g++-4.4",
|
||||
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 14.04 GCC 4.6 32/64",
|
||||
"cppalliance/droneubuntu1404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-4.6', CXXSTD: '98,0x', ADDRMD: '32,64' },
|
||||
"g++-4.6-multilib",
|
||||
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 14.04 GCC 4.7 32/64",
|
||||
"cppalliance/droneubuntu1404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '98,0x', ADDRMD: '32,64' },
|
||||
"Linux 16.04 GCC 4.7 32/64",
|
||||
"cppalliance/droneubuntu1604:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-4.7', CXXSTD: '0x', ADDRMD: '32,64' },
|
||||
"g++-4.7-multilib",
|
||||
[ "ppa:ubuntu-toolchain-r/test" ],
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 14.04 GCC 4.8* 32/64",
|
||||
"cppalliance/droneubuntu1404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11', ADDRMD: '32,64' },
|
||||
"Linux 16.04 GCC 4.8 32/64",
|
||||
"cppalliance/droneubuntu1604:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-4.8', CXXSTD: '11', ADDRMD: '32,64' },
|
||||
"g++-4.8-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 14.04 GCC 4.9 32/64",
|
||||
"cppalliance/droneubuntu1404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-4.9', CXXSTD: '03,11', ADDRMD: '32,64' },
|
||||
"Linux 16.04 GCC 4.9 32/64",
|
||||
"cppalliance/droneubuntu1604: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: '03,11,14', ADDRMD: '32,64' },
|
||||
{ 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: '03,11,14', ADDRMD: '32,64' },
|
||||
{ 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: '03,11,14,17', ADDRMD: '32,64' },
|
||||
{ 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: '03,11,14,17', ADDRMD: '32,64' },
|
||||
{ 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: '03,11,14,17,2a', ADDRMD: '32,64' },
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a', ADDRMD: '32,64' },
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 GCC 9* ARM64",
|
||||
"Linux 20.04 GCC 9* ARM64 UBSAN",
|
||||
"cppalliance/droneubuntu2004:multiarch",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' },
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' } + ubsan,
|
||||
arch="arm64",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 GCC 9* S390x",
|
||||
"Linux 20.04 GCC 9* ARM64 ASAN",
|
||||
"cppalliance/droneubuntu2004:multiarch",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '03,11,14,17,2a' },
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' } + asan,
|
||||
arch="arm64",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 GCC 9* S390x UBSAN",
|
||||
"cppalliance/droneubuntu2004:multiarch",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a' } + ubsan,
|
||||
arch="s390x",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 20.04 GCC 10 32/64",
|
||||
"cppalliance/droneubuntu2004:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-10', CXXSTD: '03,11,14,17,20', ADDRMD: '32,64' },
|
||||
{ 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: '03,11,14,17,2a', ADDRMD: '32,64' },
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++', CXXSTD: '11,14,17,2a', ADDRMD: '32,64' },
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 22.04 GCC 12 32 ASAN",
|
||||
"Linux 22.04 GCC 12 32/64",
|
||||
"cppalliance/droneubuntu2204:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '32' } + asan,
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' },
|
||||
"g++-12-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 22.04 GCC 12 64 ASAN",
|
||||
"cppalliance/droneubuntu2204:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-12', CXXSTD: '03,11,14,17,20,2b', ADDRMD: '64' } + asan,
|
||||
"g++-12-multilib",
|
||||
"Linux 23.04 GCC 13 32/64",
|
||||
"cppalliance/droneubuntu2304:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-13', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' },
|
||||
"g++-13-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 GCC 14 32/64 UBSAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + ubsan,
|
||||
"g++-14-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 24.04 GCC 14 32/64 ASAN",
|
||||
"cppalliance/droneubuntu2404:1",
|
||||
{ TOOLSET: 'gcc', COMPILER: 'g++-14', CXXSTD: '11,14,17,20,2b', ADDRMD: '32,64' } + asan,
|
||||
"g++-14-multilib",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 16.04 Clang 3.5",
|
||||
"cppalliance/droneubuntu1604:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-3.5', CXXSTD: '03,11' },
|
||||
{ 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: '03,11,14' },
|
||||
{ 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: '03,11,14' },
|
||||
{ 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: '03,11,14' },
|
||||
{ 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: '03,11,14' },
|
||||
{ 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: '03,11,14' },
|
||||
{ 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: '03,11,14,1z' },
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-5.0', CXXSTD: '11,14,1z' },
|
||||
"clang-5.0",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 18.04 Clang 6.0",
|
||||
"cppalliance/droneubuntu1804:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-6.0', CXXSTD: '03,11,14,17' },
|
||||
{ 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: '03,11,14,17' },
|
||||
{ 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: '03,11,14,17' },
|
||||
{ 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: '03,11,14,17,2a' },
|
||||
{ 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: '03,11,14,17,2a' },
|
||||
{ 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: '03,11,14,17,2a' },
|
||||
{ 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: '03,11,14,17,2a' },
|
||||
{ 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: '03,11,14,17,20' },
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-13', CXXSTD: '11,14,17,20' },
|
||||
"clang-13",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 22.04 Clang 14 UBSAN",
|
||||
"Linux 22.04 Clang 14",
|
||||
"cppalliance/droneubuntu2204:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
"clang-14",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 22.04 Clang 14 ASAN",
|
||||
"cppalliance/droneubuntu2204:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-14', CXXSTD: '03,11,14,17,20,2b' } + asan,
|
||||
{ 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: '03,11,14,17,20,2b' },
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-15', CXXSTD: '11,14,17,20,2b' },
|
||||
"clang-15",
|
||||
["deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main"],
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 23.04 Clang 16",
|
||||
"cppalliance/droneubuntu2304:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-16', CXXSTD: '11,14,17,20,2b' },
|
||||
"clang-16",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 23.10 Clang 17 UBSAN",
|
||||
"cppalliance/droneubuntu2310:1",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++-17', CXXSTD: '11,14,17,20,2b' } + ubsan,
|
||||
"clang-17",
|
||||
),
|
||||
|
||||
linux_pipeline(
|
||||
"Linux 23.10 Clang 17 ASAN",
|
||||
"cppalliance/droneubuntu2310: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",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,2a' } + ubsan,
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,2a' } + ubsan,
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 10.15 Xcode 12.2 ASAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,2a' } + asan,
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,2a' } + asan,
|
||||
),
|
||||
|
||||
macos_pipeline(
|
||||
"MacOS 12.4 Xcode 13.4.1 UBSAN",
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '03,11,14,17,20,2b' } + ubsan,
|
||||
{ TOOLSET: 'clang', COMPILER: 'clang++', CXXSTD: '11,14,17,20,2b' } + 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: '03,11,14,17,20,2b' } + 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' },
|
||||
{ TOOLSET: 'msvc-14.0', CXXSTD: '14,latest', B2_DONT_EMBED_MANIFEST: '1' },
|
||||
),
|
||||
|
||||
windows_pipeline(
|
||||
|
367
.github/workflows/ci.yml
vendored
367
.github/workflows/ci.yml
vendored
@ -17,128 +17,199 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- toolset: gcc-4.7
|
||||
cxxstd: "11"
|
||||
container: ubuntu:16.04
|
||||
os: ubuntu-latest
|
||||
install: g++-4.7-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-4.8
|
||||
cxxstd: "03,11"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "11"
|
||||
container: ubuntu:16.04
|
||||
os: ubuntu-latest
|
||||
install: g++-4.8-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-4.9
|
||||
cxxstd: "11"
|
||||
container: ubuntu:16.04
|
||||
os: ubuntu-latest
|
||||
install: g++-4.9-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-5
|
||||
cxxstd: "03,11,14,1z"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "11,14,1z"
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: g++-5-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-6
|
||||
cxxstd: "03,11,14,1z"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "11,14,1z"
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: g++-6-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-7
|
||||
cxxstd: "03,11,14,17"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "11,14,17"
|
||||
os: ubuntu-20.04
|
||||
install: g++-7-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-8
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
install: g++-8-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-9
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
cxxstd: "11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
install: g++-9-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-10
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
cxxstd: "11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
install: g++-10-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-11
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
cxxstd: "11,14,17,20,2b"
|
||||
os: ubuntu-22.04
|
||||
install: g++-11-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-12
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
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"
|
||||
container: ubuntu:23.04
|
||||
os: ubuntu-latest
|
||||
install: g++-13-multilib
|
||||
address-model: 32,64
|
||||
- toolset: gcc-14
|
||||
cxxstd: "11,14,17,20,2b"
|
||||
container: ubuntu:24.04
|
||||
os: ubuntu-latest
|
||||
install: g++-14-multilib
|
||||
address-model: 32,64
|
||||
- toolset: clang
|
||||
compiler: clang++-3.9
|
||||
cxxstd: "03,11,14"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "11,14"
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: clang-3.9
|
||||
- toolset: clang
|
||||
compiler: clang++-4.0
|
||||
cxxstd: "03,11,14"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "11,14"
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: clang-4.0
|
||||
- toolset: clang
|
||||
compiler: clang++-5.0
|
||||
cxxstd: "03,11,14,1z"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "11,14,1z"
|
||||
container: ubuntu:18.04
|
||||
os: ubuntu-latest
|
||||
install: clang-5.0
|
||||
- toolset: clang
|
||||
compiler: clang++-6.0
|
||||
cxxstd: "03,11,14,17"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "11,14,17"
|
||||
os: ubuntu-20.04
|
||||
install: clang-6.0
|
||||
- toolset: clang
|
||||
compiler: clang++-7
|
||||
cxxstd: "03,11,14,17"
|
||||
os: ubuntu-18.04
|
||||
cxxstd: "11,14,17"
|
||||
os: ubuntu-20.04
|
||||
install: clang-7
|
||||
- toolset: clang
|
||||
compiler: clang++-8
|
||||
cxxstd: "03,11,14,17"
|
||||
cxxstd: "11,14,17"
|
||||
os: ubuntu-20.04
|
||||
install: clang-8
|
||||
- toolset: clang
|
||||
compiler: clang++-9
|
||||
cxxstd: "03,11,14,17"
|
||||
cxxstd: "11,14,17"
|
||||
os: ubuntu-20.04
|
||||
install: clang-9
|
||||
- toolset: clang
|
||||
compiler: clang++-10
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
cxxstd: "11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
- toolset: clang
|
||||
compiler: clang++-11
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
cxxstd: "11,14,17,2a"
|
||||
os: ubuntu-20.04
|
||||
- toolset: clang
|
||||
compiler: clang++-12
|
||||
cxxstd: "03,11,14,17,20"
|
||||
cxxstd: "11,14,17,20"
|
||||
os: ubuntu-20.04
|
||||
- toolset: clang
|
||||
compiler: clang++-13
|
||||
cxxstd: "03,11,14,17,20"
|
||||
os: ubuntu-22.04
|
||||
cxxstd: "11,14,17,20"
|
||||
container: ubuntu:22.04
|
||||
os: ubuntu-latest
|
||||
install: clang-13
|
||||
- toolset: clang
|
||||
compiler: clang++-14
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: ubuntu-22.04
|
||||
cxxstd: "11,14,17,20,2b"
|
||||
container: ubuntu:22.04
|
||||
os: ubuntu-latest
|
||||
install: clang-14
|
||||
- toolset: clang
|
||||
compiler: clang++-15
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: ubuntu-22.04
|
||||
cxxstd: "11,14,17,20,2b"
|
||||
container: ubuntu:22.04
|
||||
os: ubuntu-latest
|
||||
install: clang-15
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
os: macos-11
|
||||
compiler: clang++-16
|
||||
cxxstd: "11,14,17,20,2b"
|
||||
container: ubuntu:23.04
|
||||
os: ubuntu-latest
|
||||
install: clang-16
|
||||
- toolset: clang
|
||||
cxxstd: "03,11,14,17,20,2b"
|
||||
os: macos-12
|
||||
compiler: clang++-17
|
||||
cxxstd: "11,14,17,20,2b"
|
||||
container: ubuntu:23.10
|
||||
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
|
||||
cxxstd: "11,14,17,20,2b"
|
||||
os: macos-13
|
||||
- toolset: clang
|
||||
cxxstd: "11,14,17,20,2b"
|
||||
os: macos-14
|
||||
- toolset: clang
|
||||
cxxstd: "11,14,17,20,2b"
|
||||
os: macos-15
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
container: ${{matrix.container}}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- name: Enable Node 16
|
||||
run: |
|
||||
echo "ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Setup container environment
|
||||
if: matrix.container
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get -y install sudo python3 git g++
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
run: sudo apt install ${{matrix.install}}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -y install ${{matrix.install}}
|
||||
|
||||
- name: Setup Boost
|
||||
run: |
|
||||
@ -158,7 +229,7 @@ jobs:
|
||||
cd boost-root
|
||||
cp -r $GITHUB_WORKSPACE/* libs/$LIBRARY
|
||||
git submodule update --init tools/boostdep
|
||||
python tools/boostdep/depinst/depinst.py --git_args "--jobs 3" $LIBRARY
|
||||
python3 tools/boostdep/depinst/depinst.py $LIBRARY
|
||||
./bootstrap.sh
|
||||
./b2 -d0 headers
|
||||
|
||||
@ -195,14 +266,14 @@ jobs:
|
||||
addrmd: 32,64
|
||||
os: windows-2022
|
||||
- toolset: gcc
|
||||
cxxstd: "03,11,14,17,2a"
|
||||
cxxstd: "11,14,17,2a"
|
||||
addrmd: 64
|
||||
os: windows-2019
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
@ -239,17 +310,19 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-11
|
||||
- os: macos-12
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
run: sudo apt install ${{matrix.install}}
|
||||
run: sudo apt-get -y install ${{matrix.install}}
|
||||
|
||||
- name: Setup Boost
|
||||
run: |
|
||||
@ -286,17 +359,19 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-11
|
||||
- os: macos-12
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
run: sudo apt install ${{matrix.install}}
|
||||
run: sudo apt-get -y install ${{matrix.install}}
|
||||
|
||||
- name: Setup Boost
|
||||
run: |
|
||||
@ -343,17 +418,19 @@ jobs:
|
||||
include:
|
||||
- os: ubuntu-20.04
|
||||
- os: ubuntu-22.04
|
||||
- os: macos-11
|
||||
- os: macos-12
|
||||
- os: ubuntu-24.04
|
||||
- os: macos-13
|
||||
- os: macos-14
|
||||
- os: macos-15
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install packages
|
||||
if: matrix.install
|
||||
run: sudo apt install ${{matrix.install}}
|
||||
run: sudo apt-get -y install ${{matrix.install}}
|
||||
|
||||
- name: Setup Boost
|
||||
run: |
|
||||
@ -390,3 +467,183 @@ jobs:
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
ctest --output-on-failure --no-tests=error
|
||||
|
||||
windows-cmake-subdir:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-2019
|
||||
- os: windows-2022
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
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%
|
||||
cd ..
|
||||
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 --git_args "--jobs 3" %LIBRARY%
|
||||
|
||||
- name: Use library with add_subdirectory (Debug)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test
|
||||
mkdir __build__ && cd __build__
|
||||
cmake ..
|
||||
cmake --build . --config Debug
|
||||
ctest --output-on-failure --no-tests=error -C Debug
|
||||
|
||||
- name: Use library with add_subdirectory (Release)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_subdir_test/__build__
|
||||
cmake --build . --config Release
|
||||
ctest --output-on-failure --no-tests=error -C Release
|
||||
|
||||
windows-cmake-install:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-2019
|
||||
- os: windows-2022
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
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%
|
||||
cd ..
|
||||
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 --git_args "--jobs 3" %LIBRARY%
|
||||
|
||||
- name: Configure
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root
|
||||
mkdir __build__ && cd __build__
|
||||
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
|
||||
|
||||
- name: Install (Debug)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
cmake --build . --target install --config Debug
|
||||
|
||||
- name: Install (Release)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
cmake --build . --target install --config Release
|
||||
|
||||
- name: Use the installed library (Debug)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test && mkdir __build__ && cd __build__
|
||||
cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
|
||||
cmake --build . --config Debug
|
||||
ctest --output-on-failure --no-tests=error -C Debug
|
||||
|
||||
- name: Use the installed library (Release)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/libs/%LIBRARY%/test/cmake_install_test/__build__
|
||||
cmake --build . --config Release
|
||||
ctest --output-on-failure --no-tests=error -C Release
|
||||
|
||||
windows-cmake-test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-2019
|
||||
- os: windows-2022
|
||||
|
||||
runs-on: ${{matrix.os}}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Boost
|
||||
shell: cmd
|
||||
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%
|
||||
cd ..
|
||||
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 --git_args "--jobs 3" %LIBRARY%
|
||||
|
||||
- name: Configure
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root
|
||||
mkdir __build__ && cd __build__
|
||||
cmake -DBOOST_INCLUDE_LIBRARIES=%LIBRARY% -DBUILD_TESTING=ON ..
|
||||
|
||||
- name: Build tests (Debug)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
cmake --build . --target tests --config Debug
|
||||
|
||||
- name: Run tests (Debug)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
ctest --output-on-failure --no-tests=error -C Debug
|
||||
|
||||
- name: Build tests (Release)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
cmake --build . --target tests --config Release
|
||||
|
||||
- name: Run tests (Release)
|
||||
shell: cmd
|
||||
run: |
|
||||
cd ../boost-root/__build__
|
||||
ctest --output-on-failure --no-tests=error -C Release
|
||||
|
@ -3,7 +3,7 @@
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.20)
|
||||
cmake_minimum_required(VERSION 3.8...3.20)
|
||||
|
||||
project(boost_function VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
|
||||
@ -18,13 +18,11 @@ target_link_libraries(boost_function
|
||||
Boost::bind
|
||||
Boost::config
|
||||
Boost::core
|
||||
Boost::preprocessor
|
||||
Boost::throw_exception
|
||||
Boost::type_index
|
||||
Boost::type_traits
|
||||
Boost::typeof
|
||||
)
|
||||
|
||||
target_compile_features(boost_function INTERFACE cxx_std_11)
|
||||
|
||||
if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
|
||||
|
||||
add_subdirectory(test)
|
||||
|
@ -7,9 +7,9 @@ into the C++11 standard as [`std::function`](https://en.cppreference.com/w/cpp/u
|
||||
|
||||
## Currently supported compilers
|
||||
|
||||
* g++ 4.8 or later
|
||||
* g++ 4.7 or later
|
||||
* clang++ 3.9 or later
|
||||
* Visual Studio 2005-2022
|
||||
* Visual Studio 2013-2022
|
||||
|
||||
Tested on [Github Actions](https://github.com/boostorg/function/actions) and [Appveyor](https://ci.appveyor.com/project/pdimov/function/).
|
||||
|
||||
|
11
appveyor.yml
11
appveyor.yml
@ -14,9 +14,6 @@ branches:
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0
|
||||
ADDRMD: 32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-12.0,msvc-14.0
|
||||
ADDRMD: 32,64
|
||||
@ -35,19 +32,19 @@ environment:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\cygwin\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
CXXSTD: 11,14,1z
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\cygwin64\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
CXXSTD: 11,14,1z
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\mingw\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
CXXSTD: 11,14,1z
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ADDPATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;
|
||||
TOOLSET: gcc
|
||||
CXXSTD: 03,11,14,1z
|
||||
CXXSTD: 11,14,1z
|
||||
|
||||
install:
|
||||
- set BOOST_BRANCH=develop
|
||||
|
24
build.jam
Normal file
24
build.jam
Normal file
@ -0,0 +1,24 @@
|
||||
# Copyright 2023-2024 René Ferdinand Rivera Morell
|
||||
# Copyright 2024 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# https://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/core//boost_core
|
||||
/boost/throw_exception//boost_throw_exception
|
||||
;
|
||||
|
||||
project /boost/function ;
|
||||
|
||||
explicit
|
||||
[ alias boost_function : : : : <include>include <library>$(boost_dependencies) ]
|
||||
[ alias all : boost_function example test ]
|
||||
;
|
||||
|
||||
call-if : boost-library function
|
||||
;
|
@ -6,9 +6,13 @@
|
||||
# See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
import ../../config/checks/config : requires ;
|
||||
require-b2 5.0.1 ;
|
||||
import-search /boost/config/checks ;
|
||||
import config : requires ;
|
||||
import testing ;
|
||||
|
||||
project : requirements <library>/boost/function//boost_function ;
|
||||
|
||||
run bind1st.cpp : : : [ requires cxx98_binders ] ;
|
||||
run int_div.cpp ;
|
||||
run sum_avg.cpp ;
|
||||
|
@ -1,3 +1,6 @@
|
||||
#ifndef BOOST_FUNCTION_HPP_INCLUDED
|
||||
#define BOOST_FUNCTION_HPP_INCLUDED
|
||||
|
||||
// Boost.Function library
|
||||
|
||||
// Copyright Douglas Gregor 2001-2003. Use, modification and
|
||||
@ -10,67 +13,6 @@
|
||||
// William Kempf, Jesse Jones and Karl Nelson were all very helpful in the
|
||||
// design of this library.
|
||||
|
||||
#ifndef BOOST_FUNCTION_MAX_ARGS
|
||||
# define BOOST_FUNCTION_MAX_ARGS 10
|
||||
#endif // BOOST_FUNCTION_MAX_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
||||
#if !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED) || (BOOST_FUNCTION_MAX_ARGS_DEFINED != BOOST_FUNCTION_MAX_ARGS)
|
||||
|
||||
#if !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED)
|
||||
#define BOOST_FUNCTION_MAX_ARGS_DEFINED 0
|
||||
#endif
|
||||
|
||||
#include <functional> // unary_function, binary_function
|
||||
|
||||
#include <boost/preprocessor/iterate.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
// Include the prologue here so that the use of file-level iteration
|
||||
// in anything that may be included by function_template.hpp doesn't break
|
||||
#include <boost/function/detail/prologue.hpp>
|
||||
|
||||
// Older Visual Age C++ version do not handle the file iteration well
|
||||
#if BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800)
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 0
|
||||
# include <boost/function/function0.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 1
|
||||
# include <boost/function/function1.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 2
|
||||
# include <boost/function/function2.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 3
|
||||
# include <boost/function/function3.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 4
|
||||
# include <boost/function/function4.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 5
|
||||
# include <boost/function/function5.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 6
|
||||
# include <boost/function/function6.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 7
|
||||
# include <boost/function/function7.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 8
|
||||
# include <boost/function/function8.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 9
|
||||
# include <boost/function/function9.hpp>
|
||||
# endif
|
||||
# if BOOST_FUNCTION_MAX_ARGS >= 10
|
||||
# include <boost/function/function10.hpp>
|
||||
# endif
|
||||
#else
|
||||
// What is the '3' for?
|
||||
# define BOOST_PP_ITERATION_PARAMS_1 (3,(0,BOOST_FUNCTION_MAX_ARGS,<boost/function/detail/function_iterate.hpp>))
|
||||
# include BOOST_PP_ITERATE()
|
||||
# undef BOOST_PP_ITERATION_PARAMS_1
|
||||
#endif
|
||||
|
||||
#include <boost/function/detail/epilogue.hpp>
|
||||
|
||||
#endif // !defined(BOOST_FUNCTION_MAX_ARGS_DEFINED) || (BOOST_FUNCTION_MAX_ARGS_DEFINED != BOOST_FUNCTION_MAX_ARGS)
|
||||
#endif // #ifndef BOOST_FUNCTION_HPP_INCLUDED
|
||||
|
@ -1,39 +0,0 @@
|
||||
// Boost.Function library
|
||||
|
||||
#ifndef BOOST_FUNCTION_EPILOGUE_HPP
|
||||
#define BOOST_FUNCTION_EPILOGUE_HPP
|
||||
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
// Resolve C++20 issue with fn == bind(...)
|
||||
// https://github.com/boostorg/function/issues/45
|
||||
|
||||
#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
namespace _bi
|
||||
{
|
||||
|
||||
template<class R, class F, class L> class bind_t;
|
||||
|
||||
} // namespace _bi
|
||||
|
||||
template<class S, class R, class F, class L> bool operator==( function<S> const& f, _bi::bind_t<R, F, L> const& b )
|
||||
{
|
||||
return f.contains( b );
|
||||
}
|
||||
|
||||
template<class S, class R, class F, class L> bool operator!=( function<S> const& f, _bi::bind_t<R, F, L> const& b )
|
||||
{
|
||||
return !f.contains( b );
|
||||
}
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // #if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
|
||||
|
||||
#endif // #ifndef BOOST_FUNCTION_EPILOGUE_HPP
|
@ -1,16 +0,0 @@
|
||||
// Boost.Function library
|
||||
|
||||
// Copyright Douglas Gregor 2003. Use, modification and
|
||||
// distribution is subject to 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)
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
# error Boost.Function - do not include this file!
|
||||
#endif
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS BOOST_PP_ITERATION()
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
|
@ -1,39 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Boost.Function library
|
||||
#
|
||||
# Copyright (C) 2001-2003 Douglas Gregor (gregod@cs.rpi.edu)
|
||||
#
|
||||
# Permission to copy, use, sell and distribute this software is granted
|
||||
# provided this copyright notice appears in all copies.
|
||||
# Permission to modify the code and to distribute modified code is granted
|
||||
# provided this copyright notice appears in all copies, and a notice
|
||||
# that the code was modified is included with the copyright notice.
|
||||
#
|
||||
# This software is provided "as is" without express or implied warranty,
|
||||
# and with no claim as to its suitability for any purpose.
|
||||
#
|
||||
# For more information, see http://www.boost.org
|
||||
use English;
|
||||
|
||||
$max_args = $ARGV[0];
|
||||
|
||||
open (OUT, ">maybe_include.hpp") or die("Cannot write to maybe_include.hpp");
|
||||
for($on_arg = 0; $on_arg <= $max_args; ++$on_arg) {
|
||||
if ($on_arg == 0) {
|
||||
print OUT "#if";
|
||||
}
|
||||
else {
|
||||
print OUT "#elif";
|
||||
}
|
||||
print OUT " BOOST_FUNCTION_NUM_ARGS == $on_arg\n";
|
||||
print OUT "# undef BOOST_FUNCTION_MAX_ARGS_DEFINED\n";
|
||||
print OUT "# define BOOST_FUNCTION_MAX_ARGS_DEFINED $on_arg\n";
|
||||
print OUT "# ifndef BOOST_FUNCTION_$on_arg\n";
|
||||
print OUT "# define BOOST_FUNCTION_$on_arg\n";
|
||||
print OUT "# include <boost/function/function_template.hpp>\n";
|
||||
print OUT "# endif\n";
|
||||
}
|
||||
print OUT "#else\n";
|
||||
print OUT "# error Cannot handle Boost.Function objects that accept more than $max_args arguments!\n";
|
||||
print OUT "#endif\n";
|
@ -1,369 +0,0 @@
|
||||
// Boost.Function library
|
||||
|
||||
// Copyright Douglas Gregor 2003. Use, modification and
|
||||
// distribution is subject to 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)
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#if BOOST_FUNCTION_NUM_ARGS == 0
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 0
|
||||
# ifndef BOOST_FUNCTION_0
|
||||
# define BOOST_FUNCTION_0
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 1
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 1
|
||||
# ifndef BOOST_FUNCTION_1
|
||||
# define BOOST_FUNCTION_1
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 2
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 2
|
||||
# ifndef BOOST_FUNCTION_2
|
||||
# define BOOST_FUNCTION_2
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 3
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 3
|
||||
# ifndef BOOST_FUNCTION_3
|
||||
# define BOOST_FUNCTION_3
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 4
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 4
|
||||
# ifndef BOOST_FUNCTION_4
|
||||
# define BOOST_FUNCTION_4
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 5
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 5
|
||||
# ifndef BOOST_FUNCTION_5
|
||||
# define BOOST_FUNCTION_5
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 6
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 6
|
||||
# ifndef BOOST_FUNCTION_6
|
||||
# define BOOST_FUNCTION_6
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 7
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 7
|
||||
# ifndef BOOST_FUNCTION_7
|
||||
# define BOOST_FUNCTION_7
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 8
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 8
|
||||
# ifndef BOOST_FUNCTION_8
|
||||
# define BOOST_FUNCTION_8
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 9
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 9
|
||||
# ifndef BOOST_FUNCTION_9
|
||||
# define BOOST_FUNCTION_9
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 10
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 10
|
||||
# ifndef BOOST_FUNCTION_10
|
||||
# define BOOST_FUNCTION_10
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 11
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 11
|
||||
# ifndef BOOST_FUNCTION_11
|
||||
# define BOOST_FUNCTION_11
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 12
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 12
|
||||
# ifndef BOOST_FUNCTION_12
|
||||
# define BOOST_FUNCTION_12
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 13
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 13
|
||||
# ifndef BOOST_FUNCTION_13
|
||||
# define BOOST_FUNCTION_13
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 14
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 14
|
||||
# ifndef BOOST_FUNCTION_14
|
||||
# define BOOST_FUNCTION_14
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 15
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 15
|
||||
# ifndef BOOST_FUNCTION_15
|
||||
# define BOOST_FUNCTION_15
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 16
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 16
|
||||
# ifndef BOOST_FUNCTION_16
|
||||
# define BOOST_FUNCTION_16
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 17
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 17
|
||||
# ifndef BOOST_FUNCTION_17
|
||||
# define BOOST_FUNCTION_17
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 18
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 18
|
||||
# ifndef BOOST_FUNCTION_18
|
||||
# define BOOST_FUNCTION_18
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 19
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 19
|
||||
# ifndef BOOST_FUNCTION_19
|
||||
# define BOOST_FUNCTION_19
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 20
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 20
|
||||
# ifndef BOOST_FUNCTION_20
|
||||
# define BOOST_FUNCTION_20
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 21
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 21
|
||||
# ifndef BOOST_FUNCTION_21
|
||||
# define BOOST_FUNCTION_21
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 22
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 22
|
||||
# ifndef BOOST_FUNCTION_22
|
||||
# define BOOST_FUNCTION_22
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 23
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 23
|
||||
# ifndef BOOST_FUNCTION_23
|
||||
# define BOOST_FUNCTION_23
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 24
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 24
|
||||
# ifndef BOOST_FUNCTION_24
|
||||
# define BOOST_FUNCTION_24
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 25
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 25
|
||||
# ifndef BOOST_FUNCTION_25
|
||||
# define BOOST_FUNCTION_25
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 26
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 26
|
||||
# ifndef BOOST_FUNCTION_26
|
||||
# define BOOST_FUNCTION_26
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 27
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 27
|
||||
# ifndef BOOST_FUNCTION_27
|
||||
# define BOOST_FUNCTION_27
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 28
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 28
|
||||
# ifndef BOOST_FUNCTION_28
|
||||
# define BOOST_FUNCTION_28
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 29
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 29
|
||||
# ifndef BOOST_FUNCTION_29
|
||||
# define BOOST_FUNCTION_29
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 30
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 30
|
||||
# ifndef BOOST_FUNCTION_30
|
||||
# define BOOST_FUNCTION_30
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 31
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 31
|
||||
# ifndef BOOST_FUNCTION_31
|
||||
# define BOOST_FUNCTION_31
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 32
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 32
|
||||
# ifndef BOOST_FUNCTION_32
|
||||
# define BOOST_FUNCTION_32
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 33
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 33
|
||||
# ifndef BOOST_FUNCTION_33
|
||||
# define BOOST_FUNCTION_33
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 34
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 34
|
||||
# ifndef BOOST_FUNCTION_34
|
||||
# define BOOST_FUNCTION_34
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 35
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 35
|
||||
# ifndef BOOST_FUNCTION_35
|
||||
# define BOOST_FUNCTION_35
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 36
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 36
|
||||
# ifndef BOOST_FUNCTION_36
|
||||
# define BOOST_FUNCTION_36
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 37
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 37
|
||||
# ifndef BOOST_FUNCTION_37
|
||||
# define BOOST_FUNCTION_37
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 38
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 38
|
||||
# ifndef BOOST_FUNCTION_38
|
||||
# define BOOST_FUNCTION_38
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 39
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 39
|
||||
# ifndef BOOST_FUNCTION_39
|
||||
# define BOOST_FUNCTION_39
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 40
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 40
|
||||
# ifndef BOOST_FUNCTION_40
|
||||
# define BOOST_FUNCTION_40
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 41
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 41
|
||||
# ifndef BOOST_FUNCTION_41
|
||||
# define BOOST_FUNCTION_41
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 42
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 42
|
||||
# ifndef BOOST_FUNCTION_42
|
||||
# define BOOST_FUNCTION_42
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 43
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 43
|
||||
# ifndef BOOST_FUNCTION_43
|
||||
# define BOOST_FUNCTION_43
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 44
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 44
|
||||
# ifndef BOOST_FUNCTION_44
|
||||
# define BOOST_FUNCTION_44
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 45
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 45
|
||||
# ifndef BOOST_FUNCTION_45
|
||||
# define BOOST_FUNCTION_45
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 46
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 46
|
||||
# ifndef BOOST_FUNCTION_46
|
||||
# define BOOST_FUNCTION_46
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 47
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 47
|
||||
# ifndef BOOST_FUNCTION_47
|
||||
# define BOOST_FUNCTION_47
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 48
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 48
|
||||
# ifndef BOOST_FUNCTION_48
|
||||
# define BOOST_FUNCTION_48
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 49
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 49
|
||||
# ifndef BOOST_FUNCTION_49
|
||||
# define BOOST_FUNCTION_49
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#elif BOOST_FUNCTION_NUM_ARGS == 50
|
||||
# undef BOOST_FUNCTION_MAX_ARGS_DEFINED
|
||||
# define BOOST_FUNCTION_MAX_ARGS_DEFINED 50
|
||||
# ifndef BOOST_FUNCTION_50
|
||||
# define BOOST_FUNCTION_50
|
||||
# include <boost/function/function_template.hpp>
|
||||
# endif
|
||||
#else
|
||||
# error Cannot handle Boost.Function objects that accept more than 50 arguments!
|
||||
#endif
|
@ -1,26 +0,0 @@
|
||||
// Boost.Function library
|
||||
|
||||
// Copyright Douglas Gregor 2002-2003. Use, modification and
|
||||
// distribution is subject to 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)
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#ifndef BOOST_FUNCTION_PROLOGUE_HPP
|
||||
#define BOOST_FUNCTION_PROLOGUE_HPP
|
||||
# include <cassert>
|
||||
# include <algorithm>
|
||||
# include <boost/config/no_tr1/functional.hpp> // unary_function, binary_function
|
||||
# include <boost/throw_exception.hpp>
|
||||
# include <boost/config.hpp>
|
||||
# include <boost/function/function_base.hpp>
|
||||
# include <boost/mem_fn.hpp>
|
||||
# include <boost/type_traits/is_integral.hpp>
|
||||
# include <boost/preprocessor/enum.hpp>
|
||||
# include <boost/preprocessor/enum_params.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/repeat.hpp>
|
||||
# include <boost/preprocessor/inc.hpp>
|
||||
# include <boost/type_traits/is_void.hpp>
|
||||
#endif // BOOST_FUNCTION_PROLOGUE_HPP
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 0
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 1
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 10
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 2
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 3
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 4
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 5
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 6
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 7
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 8
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -7,6 +7,4 @@
|
||||
|
||||
// For more information, see http://www.boost.org
|
||||
|
||||
#define BOOST_FUNCTION_NUM_ARGS 9
|
||||
#include <boost/function/detail/maybe_include.hpp>
|
||||
#undef BOOST_FUNCTION_NUM_ARGS
|
||||
#include <boost/function/function_template.hpp>
|
||||
|
@ -11,30 +11,18 @@
|
||||
#ifndef BOOST_FUNCTION_BASE_HEADER
|
||||
#define BOOST_FUNCTION_BASE_HEADER
|
||||
|
||||
#include <boost/function/function_fwd.hpp>
|
||||
#include <boost/function_equal.hpp>
|
||||
#include <boost/core/typeinfo.hpp>
|
||||
#include <boost/core/ref.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <new>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/type_index.hpp>
|
||||
#include <boost/type_traits/has_trivial_copy.hpp>
|
||||
#include <boost/type_traits/has_trivial_destructor.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#include <boost/type_traits/composite_traits.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
#include <boost/type_traits/conditional.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
#include <boost/type_traits/alignment_of.hpp>
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
#include <boost/type_traits/enable_if.hpp>
|
||||
#else
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#endif
|
||||
#include <boost/function_equal.hpp>
|
||||
#include <boost/function/function_fwd.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning( push )
|
||||
@ -42,16 +30,11 @@
|
||||
# pragma warning( disable : 4127 ) // "conditional expression is constant"
|
||||
#endif
|
||||
|
||||
#if defined(__ICL) && __ICL <= 600 || defined(__MWERKS__) && __MWERKS__ < 0x2406 && !defined(BOOST_STRICT_CONFIG)
|
||||
# define BOOST_FUNCTION_TARGET_FIX(x) x
|
||||
#else
|
||||
# define BOOST_FUNCTION_TARGET_FIX(x)
|
||||
#endif // __ICL etc
|
||||
// retained because used in a test
|
||||
#define BOOST_FUNCTION_TARGET_FIX(x)
|
||||
|
||||
# define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
|
||||
typename ::boost::enable_if_< \
|
||||
!(::boost::is_integral<Functor>::value), \
|
||||
Type>::type
|
||||
#define BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor,Type) \
|
||||
typename std::enable_if< !std::is_integral<Functor>::value, Type>::type
|
||||
|
||||
namespace boost {
|
||||
namespace detail {
|
||||
@ -73,7 +56,7 @@ namespace boost {
|
||||
// For pointers to std::type_info objects
|
||||
struct type_t {
|
||||
// (get_functor_type_tag, check_functor_type_tag).
|
||||
const boost::typeindex::type_info* type;
|
||||
const boost::core::typeinfo* type;
|
||||
|
||||
// Whether the type is const-qualified.
|
||||
bool const_qualified;
|
||||
@ -118,30 +101,6 @@ namespace boost {
|
||||
mutable char data[sizeof(function_buffer_members)];
|
||||
};
|
||||
|
||||
/**
|
||||
* The unusable class is a placeholder for unused function arguments
|
||||
* It is also completely unusable except that it constructable from
|
||||
* anything. This helps compilers without partial specialization to
|
||||
* handle Boost.Function objects returning void.
|
||||
*/
|
||||
struct unusable
|
||||
{
|
||||
unusable() {}
|
||||
template<typename T> unusable(const T&) {}
|
||||
};
|
||||
|
||||
/* Determine the return type. This supports compilers that do not support
|
||||
* void returns or partial specialization by silently changing the return
|
||||
* type to "unusable".
|
||||
*/
|
||||
template<typename T> struct function_return_type { typedef T type; };
|
||||
|
||||
template<>
|
||||
struct function_return_type<void>
|
||||
{
|
||||
typedef unusable type;
|
||||
};
|
||||
|
||||
// The operation type to perform on the given functor/function pointer
|
||||
enum functor_manager_operation_type {
|
||||
clone_functor_tag,
|
||||
@ -160,15 +119,15 @@ namespace boost {
|
||||
template<typename F>
|
||||
class get_function_tag
|
||||
{
|
||||
typedef typename conditional<(is_pointer<F>::value),
|
||||
typedef typename std::conditional<std::is_pointer<F>::value,
|
||||
function_ptr_tag,
|
||||
function_obj_tag>::type ptr_or_obj_tag;
|
||||
|
||||
typedef typename conditional<(is_member_pointer<F>::value),
|
||||
typedef typename std::conditional<std::is_member_pointer<F>::value,
|
||||
member_ptr_tag,
|
||||
ptr_or_obj_tag>::type ptr_or_obj_or_mem_tag;
|
||||
|
||||
typedef typename conditional<(is_reference_wrapper<F>::value),
|
||||
typedef typename std::conditional<is_reference_wrapper<F>::value,
|
||||
function_obj_ref_tag,
|
||||
ptr_or_obj_or_mem_tag>::type or_ref_tag;
|
||||
|
||||
@ -203,7 +162,7 @@ namespace boost {
|
||||
{
|
||||
// Check whether we have the same type. We can add
|
||||
// cv-qualifiers, but we can't take them away.
|
||||
if (*out_buffer.members.type.type == boost::typeindex::type_id<F>()
|
||||
if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(F)
|
||||
&& (!in_buffer.members.obj_ref.is_const_qualified
|
||||
|| out_buffer.members.type.const_qualified)
|
||||
&& (!in_buffer.members.obj_ref.is_volatile_qualified
|
||||
@ -215,7 +174,7 @@ namespace boost {
|
||||
return;
|
||||
|
||||
case get_functor_type_tag:
|
||||
out_buffer.members.type.type = &boost::typeindex::type_id<F>().type_info();
|
||||
out_buffer.members.type.type = &BOOST_CORE_TYPEID(F);
|
||||
out_buffer.members.type.const_qualified = in_buffer.members.obj_ref.is_const_qualified;
|
||||
out_buffer.members.type.volatile_qualified = in_buffer.members.obj_ref.is_volatile_qualified;
|
||||
return;
|
||||
@ -233,8 +192,8 @@ namespace boost {
|
||||
BOOST_STATIC_CONSTANT
|
||||
(bool,
|
||||
value = ((sizeof(F) <= sizeof(function_buffer) &&
|
||||
(alignment_of<function_buffer>::value
|
||||
% alignment_of<F>::value == 0))));
|
||||
(std::alignment_of<function_buffer>::value
|
||||
% std::alignment_of<F>::value == 0))));
|
||||
};
|
||||
|
||||
template <typename F,typename A>
|
||||
@ -275,12 +234,12 @@ namespace boost {
|
||||
} else if (op == destroy_functor_tag)
|
||||
out_buffer.members.func_ptr = 0;
|
||||
else if (op == check_functor_type_tag) {
|
||||
if (*out_buffer.members.type.type == boost::typeindex::type_id<Functor>())
|
||||
if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor))
|
||||
out_buffer.members.obj_ptr = &in_buffer.members.func_ptr;
|
||||
else
|
||||
out_buffer.members.obj_ptr = 0;
|
||||
} else /* op == get_functor_type_tag */ {
|
||||
out_buffer.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
|
||||
out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor);
|
||||
out_buffer.members.type.const_qualified = false;
|
||||
out_buffer.members.type.volatile_qualified = false;
|
||||
}
|
||||
@ -291,28 +250,27 @@ namespace boost {
|
||||
manage_small(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op)
|
||||
{
|
||||
if (op == clone_functor_tag || op == move_functor_tag) {
|
||||
if (op == clone_functor_tag) {
|
||||
const functor_type* in_functor =
|
||||
reinterpret_cast<const functor_type*>(in_buffer.data);
|
||||
new (reinterpret_cast<void*>(out_buffer.data)) functor_type(*in_functor);
|
||||
|
||||
if (op == move_functor_tag) {
|
||||
} else if (op == move_functor_tag) {
|
||||
functor_type* f = reinterpret_cast<functor_type*>(in_buffer.data);
|
||||
(void)f; // suppress warning about the value of f not being used (MSVC)
|
||||
new (reinterpret_cast<void*>(out_buffer.data)) functor_type(std::move(*f));
|
||||
f->~Functor();
|
||||
}
|
||||
} else if (op == destroy_functor_tag) {
|
||||
// Some compilers (Borland, vc6, ...) are unhappy with ~functor_type.
|
||||
functor_type* f = reinterpret_cast<functor_type*>(out_buffer.data);
|
||||
(void)f; // suppress warning about the value of f not being used (MSVC)
|
||||
f->~Functor();
|
||||
} else if (op == check_functor_type_tag) {
|
||||
if (*out_buffer.members.type.type == boost::typeindex::type_id<Functor>())
|
||||
if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor))
|
||||
out_buffer.members.obj_ptr = in_buffer.data;
|
||||
else
|
||||
out_buffer.members.obj_ptr = 0;
|
||||
} else /* op == get_functor_type_tag */ {
|
||||
out_buffer.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
|
||||
out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor);
|
||||
out_buffer.members.type.const_qualified = false;
|
||||
out_buffer.members.type.volatile_qualified = false;
|
||||
}
|
||||
@ -336,7 +294,7 @@ namespace boost {
|
||||
// Function objects that fit in the small-object buffer.
|
||||
static inline void
|
||||
manager(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op, true_type)
|
||||
functor_manager_operation_type op, std::true_type)
|
||||
{
|
||||
functor_manager_common<Functor>::manage_small(in_buffer,out_buffer,op);
|
||||
}
|
||||
@ -344,7 +302,7 @@ namespace boost {
|
||||
// Function objects that require heap allocation
|
||||
static inline void
|
||||
manager(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op, false_type)
|
||||
functor_manager_operation_type op, std::false_type)
|
||||
{
|
||||
if (op == clone_functor_tag) {
|
||||
// Clone the functor
|
||||
@ -366,12 +324,12 @@ namespace boost {
|
||||
delete f;
|
||||
out_buffer.members.obj_ptr = 0;
|
||||
} else if (op == check_functor_type_tag) {
|
||||
if (*out_buffer.members.type.type == boost::typeindex::type_id<Functor>())
|
||||
if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor))
|
||||
out_buffer.members.obj_ptr = in_buffer.members.obj_ptr;
|
||||
else
|
||||
out_buffer.members.obj_ptr = 0;
|
||||
} else /* op == get_functor_type_tag */ {
|
||||
out_buffer.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
|
||||
out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor);
|
||||
out_buffer.members.type.const_qualified = false;
|
||||
out_buffer.members.type.volatile_qualified = false;
|
||||
}
|
||||
@ -385,7 +343,7 @@ namespace boost {
|
||||
functor_manager_operation_type op, function_obj_tag)
|
||||
{
|
||||
manager(in_buffer, out_buffer, op,
|
||||
integral_constant<bool, (function_allows_small_object_optimization<functor_type>::value)>());
|
||||
std::integral_constant<bool, (function_allows_small_object_optimization<functor_type>::value)>());
|
||||
}
|
||||
|
||||
// For member pointers, we use the small-object optimization buffer.
|
||||
@ -393,7 +351,7 @@ namespace boost {
|
||||
manager(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op, member_ptr_tag)
|
||||
{
|
||||
manager(in_buffer, out_buffer, op, true_type());
|
||||
manager(in_buffer, out_buffer, op, std::true_type());
|
||||
}
|
||||
|
||||
public:
|
||||
@ -405,7 +363,7 @@ namespace boost {
|
||||
{
|
||||
typedef typename get_function_tag<functor_type>::type tag_type;
|
||||
if (op == get_functor_type_tag) {
|
||||
out_buffer.members.type.type = &boost::typeindex::type_id<functor_type>().type_info();
|
||||
out_buffer.members.type.type = &BOOST_CORE_TYPEID(functor_type);
|
||||
out_buffer.members.type.const_qualified = false;
|
||||
out_buffer.members.type.volatile_qualified = false;
|
||||
} else {
|
||||
@ -431,7 +389,7 @@ namespace boost {
|
||||
// Function objects that fit in the small-object buffer.
|
||||
static inline void
|
||||
manager(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op, true_type)
|
||||
functor_manager_operation_type op, std::true_type)
|
||||
{
|
||||
functor_manager_common<Functor>::manage_small(in_buffer,out_buffer,op);
|
||||
}
|
||||
@ -439,17 +397,12 @@ namespace boost {
|
||||
// Function objects that require heap allocation
|
||||
static inline void
|
||||
manager(const function_buffer& in_buffer, function_buffer& out_buffer,
|
||||
functor_manager_operation_type op, false_type)
|
||||
functor_manager_operation_type op, std::false_type)
|
||||
{
|
||||
typedef functor_wrapper<Functor,Allocator> functor_wrapper_type;
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
typedef typename Allocator::template rebind<functor_wrapper_type>::other
|
||||
wrapper_allocator_type;
|
||||
typedef typename wrapper_allocator_type::pointer wrapper_allocator_pointer_type;
|
||||
#else
|
||||
|
||||
using wrapper_allocator_type = typename std::allocator_traits<Allocator>::template rebind_alloc<functor_wrapper_type>;
|
||||
using wrapper_allocator_pointer_type = typename std::allocator_traits<wrapper_allocator_type>::pointer;
|
||||
#endif
|
||||
|
||||
if (op == clone_functor_tag) {
|
||||
// Clone the functor
|
||||
@ -459,11 +412,7 @@ namespace boost {
|
||||
static_cast<const functor_wrapper_type*>(in_buffer.members.obj_ptr);
|
||||
wrapper_allocator_type wrapper_allocator(static_cast<Allocator const &>(*f));
|
||||
wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1);
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
wrapper_allocator.construct(copy, *f);
|
||||
#else
|
||||
std::allocator_traits<wrapper_allocator_type>::construct(wrapper_allocator, copy, *f);
|
||||
#endif
|
||||
|
||||
// Get back to the original pointer type
|
||||
functor_wrapper_type* new_f = static_cast<functor_wrapper_type*>(copy);
|
||||
@ -476,20 +425,16 @@ namespace boost {
|
||||
functor_wrapper_type* victim =
|
||||
static_cast<functor_wrapper_type*>(in_buffer.members.obj_ptr);
|
||||
wrapper_allocator_type wrapper_allocator(static_cast<Allocator const &>(*victim));
|
||||
#if defined(BOOST_NO_CXX11_ALLOCATOR)
|
||||
wrapper_allocator.destroy(victim);
|
||||
#else
|
||||
std::allocator_traits<wrapper_allocator_type>::destroy(wrapper_allocator, victim);
|
||||
#endif
|
||||
wrapper_allocator.deallocate(victim,1);
|
||||
out_buffer.members.obj_ptr = 0;
|
||||
} else if (op == check_functor_type_tag) {
|
||||
if (*out_buffer.members.type.type == boost::typeindex::type_id<Functor>())
|
||||
if (*out_buffer.members.type.type == BOOST_CORE_TYPEID(Functor))
|
||||
out_buffer.members.obj_ptr = in_buffer.members.obj_ptr;
|
||||
else
|
||||
out_buffer.members.obj_ptr = 0;
|
||||
} else /* op == get_functor_type_tag */ {
|
||||
out_buffer.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
|
||||
out_buffer.members.type.type = &BOOST_CORE_TYPEID(Functor);
|
||||
out_buffer.members.type.const_qualified = false;
|
||||
out_buffer.members.type.volatile_qualified = false;
|
||||
}
|
||||
@ -503,7 +448,7 @@ namespace boost {
|
||||
functor_manager_operation_type op, function_obj_tag)
|
||||
{
|
||||
manager(in_buffer, out_buffer, op,
|
||||
integral_constant<bool, (function_allows_small_object_optimization<functor_type>::value)>());
|
||||
std::integral_constant<bool, (function_allows_small_object_optimization<functor_type>::value)>());
|
||||
}
|
||||
|
||||
public:
|
||||
@ -515,7 +460,7 @@ namespace boost {
|
||||
{
|
||||
typedef typename get_function_tag<functor_type>::type tag_type;
|
||||
if (op == get_functor_type_tag) {
|
||||
out_buffer.members.type.type = &boost::typeindex::type_id<functor_type>().type_info();
|
||||
out_buffer.members.type.type = &BOOST_CORE_TYPEID(functor_type);
|
||||
out_buffer.members.type.const_qualified = false;
|
||||
out_buffer.members.type.volatile_qualified = false;
|
||||
} else {
|
||||
@ -527,65 +472,6 @@ namespace boost {
|
||||
// A type that is only used for comparisons against zero
|
||||
struct useless_clear_type {};
|
||||
|
||||
#ifdef BOOST_NO_SFINAE
|
||||
// These routines perform comparisons between a Boost.Function
|
||||
// object and an arbitrary function object (when the last
|
||||
// parameter is false_type) or against zero (when the
|
||||
// last parameter is true_type). They are only necessary
|
||||
// for compilers that don't support SFINAE.
|
||||
template<typename Function, typename Functor>
|
||||
bool
|
||||
compare_equal(const Function& f, const Functor&, int, true_type)
|
||||
{ return f.empty(); }
|
||||
|
||||
template<typename Function, typename Functor>
|
||||
bool
|
||||
compare_not_equal(const Function& f, const Functor&, int,
|
||||
true_type)
|
||||
{ return !f.empty(); }
|
||||
|
||||
template<typename Function, typename Functor>
|
||||
bool
|
||||
compare_equal(const Function& f, const Functor& g, long,
|
||||
false_type)
|
||||
{
|
||||
if (const Functor* fp = f.template target<Functor>())
|
||||
return function_equal(*fp, g);
|
||||
else return false;
|
||||
}
|
||||
|
||||
template<typename Function, typename Functor>
|
||||
bool
|
||||
compare_equal(const Function& f, const reference_wrapper<Functor>& g,
|
||||
int, false_type)
|
||||
{
|
||||
if (const Functor* fp = f.template target<Functor>())
|
||||
return fp == g.get_pointer();
|
||||
else return false;
|
||||
}
|
||||
|
||||
template<typename Function, typename Functor>
|
||||
bool
|
||||
compare_not_equal(const Function& f, const Functor& g, long,
|
||||
false_type)
|
||||
{
|
||||
if (const Functor* fp = f.template target<Functor>())
|
||||
return !function_equal(*fp, g);
|
||||
else return true;
|
||||
}
|
||||
|
||||
template<typename Function, typename Functor>
|
||||
bool
|
||||
compare_not_equal(const Function& f,
|
||||
const reference_wrapper<Functor>& g, int,
|
||||
false_type)
|
||||
{
|
||||
if (const Functor* fp = f.template target<Functor>())
|
||||
return fp != g.get_pointer();
|
||||
else return true;
|
||||
}
|
||||
#endif // BOOST_NO_SFINAE
|
||||
|
||||
/**
|
||||
* Stores the "manager" portion of the vtable for a
|
||||
* boost::function object.
|
||||
@ -615,9 +501,9 @@ public:
|
||||
|
||||
/** Retrieve the type of the stored function object, or type_id<void>()
|
||||
if this is empty. */
|
||||
const boost::typeindex::type_info& target_type() const
|
||||
const boost::core::typeinfo& target_type() const
|
||||
{
|
||||
if (!vtable) return boost::typeindex::type_id<void>().type_info();
|
||||
if (!vtable) return BOOST_CORE_TYPEID(void);
|
||||
|
||||
detail::function::function_buffer type;
|
||||
get_vtable()->manager(functor, type, detail::function::get_functor_type_tag);
|
||||
@ -630,9 +516,9 @@ public:
|
||||
if (!vtable) return 0;
|
||||
|
||||
detail::function::function_buffer type_result;
|
||||
type_result.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
|
||||
type_result.members.type.const_qualified = is_const<Functor>::value;
|
||||
type_result.members.type.volatile_qualified = is_volatile<Functor>::value;
|
||||
type_result.members.type.type = &BOOST_CORE_TYPEID(Functor);
|
||||
type_result.members.type.const_qualified = std::is_const<Functor>::value;
|
||||
type_result.members.type.volatile_qualified = std::is_volatile<Functor>::value;
|
||||
get_vtable()->manager(functor, type_result,
|
||||
detail::function::check_functor_type_tag);
|
||||
return static_cast<Functor*>(type_result.members.obj_ptr);
|
||||
@ -644,9 +530,9 @@ public:
|
||||
if (!vtable) return 0;
|
||||
|
||||
detail::function::function_buffer type_result;
|
||||
type_result.members.type.type = &boost::typeindex::type_id<Functor>().type_info();
|
||||
type_result.members.type.type = &BOOST_CORE_TYPEID(Functor);
|
||||
type_result.members.type.const_qualified = true;
|
||||
type_result.members.type.volatile_qualified = is_volatile<Functor>::value;
|
||||
type_result.members.type.volatile_qualified = std::is_volatile<Functor>::value;
|
||||
get_vtable()->manager(functor, type_result,
|
||||
detail::function::check_functor_type_tag);
|
||||
// GCC 2.95.3 gets the CV qualifiers wrong here, so we
|
||||
@ -655,7 +541,8 @@ public:
|
||||
}
|
||||
|
||||
template<typename F>
|
||||
bool contains(const F& f) const
|
||||
typename std::enable_if< !std::is_function<F>::value, bool >::type
|
||||
contains(const F& f) const
|
||||
{
|
||||
if (const F* fp = this->template target<F>())
|
||||
{
|
||||
@ -665,29 +552,19 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3
|
||||
// GCC 3.3 and newer cannot copy with the global operator==, due to
|
||||
// problems with instantiation of function return types before it
|
||||
// has been verified that the argument types match up.
|
||||
template<typename Functor>
|
||||
BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
|
||||
operator==(Functor g) const
|
||||
template<typename Fn>
|
||||
typename std::enable_if< std::is_function<Fn>::value, bool >::type
|
||||
contains(Fn& f) const
|
||||
{
|
||||
if (const Functor* fp = target<Functor>())
|
||||
return function_equal(*fp, g);
|
||||
else return false;
|
||||
typedef Fn* F;
|
||||
if (const F* fp = this->template target<F>())
|
||||
{
|
||||
return function_equal(*fp, &f);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename Functor>
|
||||
BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
|
||||
operator!=(Functor g) const
|
||||
{
|
||||
if (const Functor* fp = target<Functor>())
|
||||
return !function_equal(*fp, g);
|
||||
else return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
public: // should be protected, but GCC 2.95.3 will fail to allow access
|
||||
detail::function::vtable_base* get_vtable() const {
|
||||
return reinterpret_cast<detail::function::vtable_base*>(
|
||||
@ -719,7 +596,6 @@ public:
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_NO_SFINAE
|
||||
inline bool operator==(const function_base& f,
|
||||
detail::function::useless_clear_type*)
|
||||
{
|
||||
@ -743,43 +619,10 @@ inline bool operator!=(detail::function::useless_clear_type*,
|
||||
{
|
||||
return !f.empty();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_NO_SFINAE
|
||||
// Comparisons between boost::function objects and arbitrary function objects
|
||||
template<typename Functor>
|
||||
inline bool operator==(const function_base& f, Functor g)
|
||||
{
|
||||
typedef integral_constant<bool, (is_integral<Functor>::value)> integral;
|
||||
return detail::function::compare_equal(f, g, 0, integral());
|
||||
}
|
||||
|
||||
template<typename Functor>
|
||||
inline bool operator==(Functor g, const function_base& f)
|
||||
{
|
||||
typedef integral_constant<bool, (is_integral<Functor>::value)> integral;
|
||||
return detail::function::compare_equal(f, g, 0, integral());
|
||||
}
|
||||
|
||||
template<typename Functor>
|
||||
inline bool operator!=(const function_base& f, Functor g)
|
||||
{
|
||||
typedef integral_constant<bool, (is_integral<Functor>::value)> integral;
|
||||
return detail::function::compare_not_equal(f, g, 0, integral());
|
||||
}
|
||||
|
||||
template<typename Functor>
|
||||
inline bool operator!=(Functor g, const function_base& f)
|
||||
{
|
||||
typedef integral_constant<bool, (is_integral<Functor>::value)> integral;
|
||||
return detail::function::compare_not_equal(f, g, 0, integral());
|
||||
}
|
||||
#else
|
||||
|
||||
# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
|
||||
// Comparisons between boost::function objects and arbitrary function
|
||||
// objects. GCC 3.3 and before has an obnoxious bug that prevents this
|
||||
// from working.
|
||||
// objects.
|
||||
|
||||
template<typename Functor>
|
||||
BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
|
||||
operator==(const function_base& f, Functor g)
|
||||
@ -815,7 +658,6 @@ template<typename Functor>
|
||||
return !function_equal(g, *fp);
|
||||
else return true;
|
||||
}
|
||||
# endif
|
||||
|
||||
template<typename Functor>
|
||||
BOOST_FUNCTION_ENABLE_IF_NOT_INTEGRAL(Functor, bool)
|
||||
@ -853,8 +695,6 @@ template<typename Functor>
|
||||
else return true;
|
||||
}
|
||||
|
||||
#endif // Compiler supporting SFINAE
|
||||
|
||||
namespace detail {
|
||||
namespace function {
|
||||
inline bool has_empty_target(const function_base* f)
|
||||
|
@ -10,24 +10,9 @@
|
||||
#define BOOST_FUNCTION_FWD_HPP
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(__sgi) && defined(_COMPILER_VERSION) && _COMPILER_VERSION <= 730 && !defined(BOOST_STRICT_CONFIG)
|
||||
// Work around a compiler bug.
|
||||
// boost::python::objects::function has to be seen by the compiler before the
|
||||
// boost::function class template.
|
||||
namespace boost { namespace python { namespace objects {
|
||||
class function;
|
||||
}}}
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG) \
|
||||
|| !(defined(BOOST_STRICT_CONFIG) || !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x540)
|
||||
# define BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
class bad_function_call;
|
||||
|
||||
#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
|
||||
// Preferred syntax
|
||||
template<typename Signature> class function;
|
||||
|
||||
@ -36,34 +21,44 @@ namespace boost {
|
||||
{
|
||||
f1.swap(f2);
|
||||
}
|
||||
#endif // have partial specialization
|
||||
|
||||
// Portable syntax
|
||||
template<typename R> class function0;
|
||||
template<typename R, typename T1> class function1;
|
||||
template<typename R, typename T1, typename T2> class function2;
|
||||
template<typename R, typename T1, typename T2, typename T3> class function3;
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4>
|
||||
class function4;
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5>
|
||||
class function5;
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6>
|
||||
class function6;
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6, typename T7>
|
||||
class function7;
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6, typename T7, typename T8>
|
||||
class function8;
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6, typename T7, typename T8, typename T9>
|
||||
class function9;
|
||||
template<typename R, typename T1, typename T2, typename T3, typename T4,
|
||||
typename T5, typename T6, typename T7, typename T8, typename T9,
|
||||
typename T10>
|
||||
class function10;
|
||||
template<typename R, typename... T> class function_n;
|
||||
|
||||
template<typename R, typename... T> using function0 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function1 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function2 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function3 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function4 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function5 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function6 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function7 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function8 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function9 = function_n<R, T...>;
|
||||
|
||||
template<typename R, typename... T> using function10 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function11 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function12 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function13 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function14 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function15 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function16 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function17 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function18 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function19 = function_n<R, T...>;
|
||||
|
||||
template<typename R, typename... T> using function20 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function21 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function22 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function23 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function24 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function25 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function26 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function27 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function28 = function_n<R, T...>;
|
||||
template<typename R, typename... T> using function29 = function_n<R, T...>;
|
||||
|
||||
template<typename R, typename... T> using function30 = function_n<R, T...>;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -9,37 +9,7 @@
|
||||
#ifndef BOOST_FUNCTION_TYPEOF_HPP
|
||||
#define BOOST_FUNCTION_TYPEOF_HPP
|
||||
#include <boost/function/function_fwd.hpp>
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
|
||||
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
||||
// This header is no longer necessary and is only retained for compatibility
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TYPE(boost::bad_function_call)
|
||||
|
||||
#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function, (typename))
|
||||
#endif
|
||||
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function0, (typename))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function1, (typename)(typename))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function2, (typename)(typename)(typename))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function3,
|
||||
(typename)(typename)(typename)(typename))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function4,
|
||||
(typename)(typename)(typename)(typename)(typename))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function5,
|
||||
(typename)(typename)(typename)(typename)(typename)(typename))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function6,
|
||||
(typename)(typename)(typename)(typename)(typename)(typename)(typename))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function7,
|
||||
(typename)(typename)(typename)(typename)(typename)(typename)(typename)
|
||||
(typename))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function8,
|
||||
(typename)(typename)(typename)(typename)(typename)(typename)(typename)
|
||||
(typename)(typename))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function9,
|
||||
(typename)(typename)(typename)(typename)(typename)(typename)(typename)
|
||||
(typename)(typename)(typename))
|
||||
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::function10,
|
||||
(typename)(typename)(typename)(typename)(typename)(typename)(typename)
|
||||
(typename)(typename)(typename)(typename))
|
||||
#endif
|
||||
|
@ -1,26 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# Boost.Function library
|
||||
#
|
||||
# Copyright Douglas Gregor 2001-2003. Use, modification and
|
||||
# distribution is subject to 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)
|
||||
#
|
||||
# For more information, see http://www.boost.org
|
||||
use English;
|
||||
|
||||
if ($#ARGV < 0) {
|
||||
print "Usage: perl gen_function_N <number of arguments>\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$totalNumArgs = $ARGV[0];
|
||||
for ($numArgs = 0; $numArgs <= $totalNumArgs; ++$numArgs) {
|
||||
open OUT, ">function$numArgs.hpp";
|
||||
print OUT "#define BOOST_FUNCTION_NUM_ARGS $numArgs\n";
|
||||
print OUT "#include <boost/function/detail/maybe_include.hpp>\n";
|
||||
print OUT "#undef BOOST_FUNCTION_NUM_ARGS\n";
|
||||
close OUT;
|
||||
}
|
@ -15,5 +15,5 @@
|
||||
"maintainers": [
|
||||
"Peter Dimov <pdimov -at- gmail.com>"
|
||||
],
|
||||
"cxxstd": "03"
|
||||
"cxxstd": "11"
|
||||
}
|
||||
|
@ -6,6 +6,6 @@ include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
|
||||
|
||||
if(HAVE_BOOST_TEST)
|
||||
|
||||
boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::function Boost::core Boost::lambda)
|
||||
boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::function Boost::core Boost::lambda Boost::move)
|
||||
|
||||
endif()
|
||||
|
@ -16,6 +16,8 @@ project
|
||||
<toolset>msvc:<warnings-as-errors>on
|
||||
<toolset>gcc:<warnings-as-errors>on
|
||||
<toolset>clang:<warnings-as-errors>on
|
||||
<library>/boost/function//boost_function
|
||||
<library>/boost/typeof//boost_typeof
|
||||
;
|
||||
|
||||
run function_test.cpp ;
|
||||
@ -24,7 +26,8 @@ run function_test.cpp : : : <rtti>off <toolset>gcc-4.4,<cxxstd>0x:<build>no : fu
|
||||
run function_n_test.cpp ;
|
||||
run allocator_test.cpp ;
|
||||
run stateless_test.cpp ;
|
||||
run lambda_test.cpp ;
|
||||
run lambda_test.cpp
|
||||
: : : <library>/boost/lambda//boost_lambda ;
|
||||
compile-fail function_test_fail1.cpp ;
|
||||
compile-fail function_test_fail2.cpp ;
|
||||
compile function_30.cpp ;
|
||||
@ -42,9 +45,12 @@ run function_ref_portable.cpp ;
|
||||
run contains_test.cpp ;
|
||||
run contains2_test.cpp ;
|
||||
run nothrow_swap.cpp ;
|
||||
run rvalues_test.cpp ;
|
||||
compile function_typeof_test.cpp ;
|
||||
run rvalues_test.cpp
|
||||
: : : <library>/boost/move//boost_move ;
|
||||
compile function_typeof_test.cpp
|
||||
: <cxxstd>03:<build>no <cxxstd>98:<build>no <cxxstd>0x:<build>no ;
|
||||
run result_arg_types_test.cpp ;
|
||||
run result_arg_n_types_test.cpp ;
|
||||
|
||||
lib throw_bad_function_call : throw_bad_function_call.cpp : <link>shared:<define>THROW_BAD_FUNCTION_CALL_DYN_LINK=1 ;
|
||||
|
||||
@ -56,9 +62,6 @@ lib mixed_cxxstd : mixed_cxxstd.cpp : <link>shared:<define>MIXED_CXXSTD_DYN_LINK
|
||||
run test_mixed_cxxstd.cpp mixed_cxxstd : : : <link>shared : mixed_cxxstd_shared ;
|
||||
run test_mixed_cxxstd.cpp mixed_cxxstd : : : <link>static : mixed_cxxstd_static ;
|
||||
|
||||
run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>98 : : : <link>shared : mixed_cxxstd_shared_98 ;
|
||||
run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>98 : : : <link>static : mixed_cxxstd_static_98 ;
|
||||
|
||||
run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>0x : : : <link>shared : mixed_cxxstd_shared_0x ;
|
||||
run test_mixed_cxxstd.cpp mixed_cxxstd/<cxxstd>0x : : : <link>static : mixed_cxxstd_static_0x ;
|
||||
|
||||
@ -72,9 +75,6 @@ lib return_function : return_function.cpp : <link>shared:<define>RETURN_FUNCTION
|
||||
run test_return_function.cpp return_function : : : <link>shared : return_function_shared ;
|
||||
run test_return_function.cpp return_function : : : <link>static : return_function_static ;
|
||||
|
||||
run test_return_function.cpp return_function/<cxxstd>98 : : : <link>shared : return_function_shared_98 ;
|
||||
run test_return_function.cpp return_function/<cxxstd>98 : : : <link>static : return_function_static_98 ;
|
||||
|
||||
run test_return_function.cpp return_function/<cxxstd>0x : : : <link>shared : return_function_shared_0x ;
|
||||
run test_return_function.cpp return_function/<cxxstd>0x : : : <link>static : return_function_static_0x ;
|
||||
|
||||
@ -86,3 +86,12 @@ run quick.cpp ;
|
||||
compile issue_42.cpp ;
|
||||
|
||||
run fn_eq_bind_test.cpp ;
|
||||
|
||||
# /usr/include/c++/4.4/bits/shared_ptr.h:146: error: cannot use typeid with -fno-rtti
|
||||
run contains_test.cpp : : : <rtti>off <toolset>gcc-4.4,<cxxstd>0x:<build>no : contains_test_no_rtti ;
|
||||
run contains2_test.cpp : : : <rtti>off <toolset>gcc-4.4,<cxxstd>0x:<build>no : contains2_test_no_rtti ;
|
||||
|
||||
run contains3_test.cpp ;
|
||||
run contains3_test.cpp : : : <rtti>off <toolset>gcc-4.4,<cxxstd>0x:<build>no : contains3_test_no_rtti ;
|
||||
|
||||
compile issue_53.cpp ;
|
||||
|
@ -14,4 +14,4 @@ target_link_libraries(main Boost::function)
|
||||
enable_testing()
|
||||
add_test(main main)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
|
@ -16,18 +16,11 @@ assert
|
||||
bind
|
||||
config
|
||||
core
|
||||
preprocessor
|
||||
throw_exception
|
||||
type_index
|
||||
type_traits
|
||||
typeof
|
||||
|
||||
# Secondary dependencies
|
||||
|
||||
static_assert
|
||||
container_hash
|
||||
describe
|
||||
mp11
|
||||
)
|
||||
|
||||
foreach(dep IN LISTS deps)
|
||||
@ -44,4 +37,4 @@ target_link_libraries(quick Boost::function Boost::core)
|
||||
enable_testing()
|
||||
add_test(quick quick)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
add_custom_target(check VERBATIM COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
||||
|
33
test/contains3_test.cpp
Normal file
33
test/contains3_test.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright 2023 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/core/lightweight_test.hpp>
|
||||
|
||||
static int f()
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int g()
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
boost::function<int()> fn;
|
||||
BOOST_TEST( !fn.contains( f ) );
|
||||
BOOST_TEST( !fn.contains( g ) );
|
||||
}
|
||||
|
||||
{
|
||||
boost::function<int()> fn( f );
|
||||
BOOST_TEST( fn.contains( f ) );
|
||||
BOOST_TEST( !fn.contains( g ) );
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -33,7 +33,7 @@ bool operator==(const ReturnInt& x, const ReturnInt& y)
|
||||
bool operator!=(const ReturnInt& x, const ReturnInt& y)
|
||||
{ return x.value != y.value; }
|
||||
|
||||
namespace contain_test {
|
||||
namespace contains_test {
|
||||
|
||||
struct ReturnIntFE
|
||||
{
|
||||
@ -44,34 +44,10 @@ struct ReturnIntFE
|
||||
int value;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
|
||||
|
||||
namespace contain_test {
|
||||
# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
bool function_equal(const ReturnIntFE& x, const ReturnIntFE& y)
|
||||
{ return x.value == y.value; }
|
||||
# else
|
||||
bool function_equal_impl(const ReturnIntFE& x, const ReturnIntFE& y, int)
|
||||
{ return x.value == y.value; }
|
||||
# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
}
|
||||
#else // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
|
||||
namespace boost {
|
||||
# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
|
||||
bool
|
||||
function_equal(const contain_test::ReturnIntFE& x,
|
||||
const contain_test::ReturnIntFE& y)
|
||||
{ return x.value == y.value; }
|
||||
# else
|
||||
bool
|
||||
function_equal_impl(const contain_test::ReturnIntFE& x,
|
||||
const contain_test::ReturnIntFE& y, int)
|
||||
{ return x.value == y.value; }
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace contains_test
|
||||
|
||||
static void target_test()
|
||||
{
|
||||
@ -108,10 +84,8 @@ static void equal_test()
|
||||
f = &forty_two;
|
||||
BOOST_CHECK(f == &forty_two);
|
||||
BOOST_CHECK(f != ReturnInt(17));
|
||||
#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
|
||||
BOOST_CHECK(&forty_two == f);
|
||||
BOOST_CHECK(ReturnInt(17) != f);
|
||||
#endif
|
||||
|
||||
BOOST_CHECK(f.contains(&forty_two));
|
||||
|
||||
@ -119,47 +93,37 @@ static void equal_test()
|
||||
BOOST_CHECK(f != &forty_two);
|
||||
BOOST_CHECK(f == ReturnInt(17));
|
||||
BOOST_CHECK(f != ReturnInt(16));
|
||||
#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
|
||||
BOOST_CHECK(&forty_two != f);
|
||||
BOOST_CHECK(ReturnInt(17) == f);
|
||||
BOOST_CHECK(ReturnInt(16) != f);
|
||||
#endif
|
||||
|
||||
BOOST_CHECK(f.contains(ReturnInt(17)));
|
||||
|
||||
f = contain_test::ReturnIntFE(17);
|
||||
f = contains_test::ReturnIntFE(17);
|
||||
BOOST_CHECK(f != &forty_two);
|
||||
BOOST_CHECK(f == contain_test::ReturnIntFE(17));
|
||||
BOOST_CHECK(f != contain_test::ReturnIntFE(16));
|
||||
#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
|
||||
BOOST_CHECK(f == contains_test::ReturnIntFE(17));
|
||||
BOOST_CHECK(f != contains_test::ReturnIntFE(16));
|
||||
BOOST_CHECK(&forty_two != f);
|
||||
BOOST_CHECK(contain_test::ReturnIntFE(17) == f);
|
||||
BOOST_CHECK(contain_test::ReturnIntFE(16) != f);
|
||||
#endif
|
||||
BOOST_CHECK(contains_test::ReturnIntFE(17) == f);
|
||||
BOOST_CHECK(contains_test::ReturnIntFE(16) != f);
|
||||
|
||||
BOOST_CHECK(f.contains(contain_test::ReturnIntFE(17)));
|
||||
BOOST_CHECK(f.contains(contains_test::ReturnIntFE(17)));
|
||||
|
||||
#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
|
||||
boost::function<int(void)> g;
|
||||
|
||||
g = &forty_two;
|
||||
BOOST_CHECK(g == &forty_two);
|
||||
BOOST_CHECK(g != ReturnInt(17));
|
||||
# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
|
||||
BOOST_CHECK(&forty_two == g);
|
||||
BOOST_CHECK(ReturnInt(17) != g);
|
||||
# endif
|
||||
|
||||
g = ReturnInt(17);
|
||||
BOOST_CHECK(g != &forty_two);
|
||||
BOOST_CHECK(g == ReturnInt(17));
|
||||
BOOST_CHECK(g != ReturnInt(16));
|
||||
# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
|
||||
BOOST_CHECK(&forty_two != g);
|
||||
BOOST_CHECK(ReturnInt(17) == g);
|
||||
BOOST_CHECK(ReturnInt(16) != g);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void ref_equal_test()
|
||||
@ -175,10 +139,8 @@ static void ref_equal_test()
|
||||
BOOST_CHECK(!(f != boost::ref(ri)));
|
||||
BOOST_CHECK(!(f != ri));
|
||||
BOOST_CHECK(!(boost::ref(ri) != f));
|
||||
#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
|
||||
BOOST_CHECK(ri == f);
|
||||
BOOST_CHECK(!(ri != f));
|
||||
#endif
|
||||
|
||||
// Values equal, references inequal
|
||||
ReturnInt ri2(17);
|
||||
@ -188,13 +150,10 @@ static void ref_equal_test()
|
||||
BOOST_CHECK(!(f != ri2));
|
||||
BOOST_CHECK(!(f == boost::ref(ri2)));
|
||||
BOOST_CHECK(!(boost::ref(ri2) == f));
|
||||
#if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
|
||||
BOOST_CHECK(ri2 == f);
|
||||
BOOST_CHECK(!(ri2 != f));
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
|
||||
{
|
||||
ReturnInt ri(17);
|
||||
boost::function<int(void)> f = boost::ref(ri);
|
||||
@ -206,10 +165,8 @@ static void ref_equal_test()
|
||||
BOOST_CHECK(!(f != boost::ref(ri)));
|
||||
BOOST_CHECK(!(f != ri));
|
||||
BOOST_CHECK(!(boost::ref(ri) != f));
|
||||
# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
|
||||
BOOST_CHECK(ri == f);
|
||||
BOOST_CHECK(!(ri != f));
|
||||
# endif
|
||||
|
||||
// Values equal, references inequal
|
||||
ReturnInt ri2(17);
|
||||
@ -219,12 +176,9 @@ static void ref_equal_test()
|
||||
BOOST_CHECK(!(f != ri2));
|
||||
BOOST_CHECK(!(f == boost::ref(ri2)));
|
||||
BOOST_CHECK(!(boost::ref(ri2) == f));
|
||||
# if !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
|
||||
BOOST_CHECK(ri2 == f);
|
||||
BOOST_CHECK(!(ri2 != f));
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int main()
|
||||
|
@ -754,7 +754,6 @@ static void test_move_semantics()
|
||||
BOOST_CHECK(!f1.empty());
|
||||
BOOST_CHECK(global_int == 1);
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
// Testing rvalue constructors
|
||||
f1_type f2(static_cast<f1_type&&>(f1));
|
||||
BOOST_CHECK(f1.empty());
|
||||
@ -796,8 +795,6 @@ static void test_move_semantics()
|
||||
BOOST_CHECK(global_int == 5);
|
||||
f4 = static_cast<f1_type&&>(f5);
|
||||
BOOST_CHECK(global_int == 4);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
int main()
|
||||
|
20
test/issue_53.cpp
Normal file
20
test/issue_53.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright 2024 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
//
|
||||
// https://github.com/boostorg/function/issues/53
|
||||
|
||||
#include <boost/bind/apply.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#include <boost/function.hpp>
|
||||
|
||||
int TestArg( int, double )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void f()
|
||||
{
|
||||
boost::function<int(int)> fn = boost::bind( &TestArg, boost::placeholders::_1, 1.0 );
|
||||
}
|
146
test/result_arg_n_types_test.cpp
Normal file
146
test/result_arg_n_types_test.cpp
Normal file
@ -0,0 +1,146 @@
|
||||
// Copyright 2024 Peter Dimov
|
||||
// Use, modification and distribution is subject to
|
||||
// the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/core/lightweight_test_trait.hpp>
|
||||
|
||||
struct R {};
|
||||
|
||||
struct A1 {};
|
||||
struct A2 {};
|
||||
struct A3 {};
|
||||
struct A4 {};
|
||||
struct A5 {};
|
||||
struct A6 {};
|
||||
struct A7 {};
|
||||
struct A8 {};
|
||||
struct A9 {};
|
||||
struct A10 {};
|
||||
|
||||
int main()
|
||||
{
|
||||
{
|
||||
typedef boost::function<R()> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::function<R(A1)> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg1_type, A1);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::function<R(A1, A2)> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg1_type, A1);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg2_type, A2);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::function<R(A1, A2, A3)> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg1_type, A1);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg2_type, A2);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg3_type, A3);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::function<R(A1, A2, A3, A4)> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg1_type, A1);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg2_type, A2);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg3_type, A3);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg4_type, A4);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::function<R(A1, A2, A3, A4, A5)> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg1_type, A1);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg2_type, A2);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg3_type, A3);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg4_type, A4);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg5_type, A5);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::function<R(A1, A2, A3, A4, A5, A6)> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg1_type, A1);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg2_type, A2);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg3_type, A3);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg4_type, A4);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg5_type, A5);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg6_type, A6);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::function<R(A1, A2, A3, A4, A5, A6, A7)> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg1_type, A1);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg2_type, A2);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg3_type, A3);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg4_type, A4);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg5_type, A5);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg6_type, A6);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg7_type, A7);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::function<R(A1, A2, A3, A4, A5, A6, A7, A8)> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg1_type, A1);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg2_type, A2);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg3_type, A3);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg4_type, A4);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg5_type, A5);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg6_type, A6);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg7_type, A7);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg8_type, A8);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg1_type, A1);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg2_type, A2);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg3_type, A3);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg4_type, A4);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg5_type, A5);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg6_type, A6);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg7_type, A7);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg8_type, A8);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg9_type, A9);
|
||||
}
|
||||
|
||||
{
|
||||
typedef boost::function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> F;
|
||||
|
||||
BOOST_TEST_TRAIT_SAME(F::result_type, R);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg1_type, A1);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg2_type, A2);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg3_type, A3);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg4_type, A4);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg5_type, A5);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg6_type, A6);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg7_type, A7);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg8_type, A8);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg9_type, A9);
|
||||
BOOST_TEST_TRAIT_SAME(F::arg10_type, A10);
|
||||
}
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
@ -59,10 +59,8 @@ struct sum_struct {
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
int three(std::string&&) { return 1; }
|
||||
std::string&& four(std::string&& s) { return boost::move(s); }
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
@ -95,13 +93,11 @@ int main()
|
||||
BOOST_CHECK(om2_sum_2.get_value() == 3);
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
function <int(std::string&&)> f3 = three;
|
||||
function <std::string&& (std::string&& s)> f4 = four;
|
||||
|
||||
f3(std::string("Hello"));
|
||||
BOOST_CHECK(f4(std::string("world")) == "world");
|
||||
#endif
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
Reference in New Issue
Block a user