mirror of
https://github.com/boostorg/parameter.git
synced 2026-01-19 16:32:13 +00:00
Compare commits
486 Commits
svn-branch
...
boost-1.74
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c31433af1f | ||
|
|
0f548424a5 | ||
|
|
ba78e65f93 | ||
|
|
5a2328751a | ||
|
|
e80fba3fd9 | ||
|
|
0d482ed0cf | ||
|
|
1baff677d5 | ||
|
|
a028278ec5 | ||
|
|
3d430b22be | ||
|
|
c2f24094f1 | ||
|
|
a6024c0ec7 | ||
|
|
6037aee098 | ||
|
|
2d7414f095 | ||
|
|
a0ed362e76 | ||
|
|
015aff617b | ||
|
|
e2d589dec7 | ||
|
|
f933d797fe | ||
|
|
979d8091ad | ||
|
|
75e9295748 | ||
|
|
dc6cb9a2fd | ||
|
|
c28195f464 | ||
|
|
3876bdf4b2 | ||
|
|
0bb3ba54da | ||
|
|
8f2cd502bf | ||
|
|
914b0a32c8 | ||
|
|
0ba17c2e2a | ||
|
|
e3849687e4 | ||
|
|
e24f86a7fa | ||
|
|
384cd299ec | ||
|
|
241be29095 | ||
|
|
309dd7e1c1 | ||
|
|
dbf4dd24f5 | ||
|
|
6509aa3bad | ||
|
|
3ced1d1ac8 | ||
|
|
5e80ac9882 | ||
|
|
7812625cdd | ||
|
|
fd2ecd6924 | ||
|
|
7d1cee2cb7 | ||
|
|
352f6fb4a8 | ||
|
|
2482e7db56 | ||
|
|
52c440a5ae | ||
|
|
9f778f0d62 | ||
|
|
af3411f506 | ||
|
|
66a363b4c6 | ||
|
|
e0b16eb3e9 | ||
|
|
4170d35555 | ||
|
|
541e9ade24 | ||
|
|
3bf8242fe4 | ||
|
|
9bde4a2260 | ||
|
|
f453a586f3 | ||
|
|
7b2d3f6e41 | ||
|
|
2b796a8746 | ||
|
|
e7c2118e91 | ||
|
|
6bce8119bf | ||
|
|
fe73177b6c | ||
|
|
59616f3a0a | ||
|
|
54a3f15a57 | ||
|
|
9a84ed5cdb | ||
|
|
8d1c3f57a1 | ||
|
|
fb5683766b | ||
|
|
977ff25b1b | ||
|
|
4a5356b229 | ||
|
|
69db508992 | ||
|
|
689a9525d4 | ||
|
|
e2896116be | ||
|
|
313cde1d99 | ||
|
|
ead2cb4519 | ||
|
|
a2f68bea6c | ||
|
|
b5f02c0aaa | ||
|
|
515c80fad5 | ||
|
|
b531b64f7b | ||
|
|
1fde7ae869 | ||
|
|
cb267e5125 | ||
|
|
387449a12c | ||
|
|
c465139bc2 | ||
|
|
e5337e2503 | ||
|
|
f2083c84ec | ||
|
|
261819d9bb | ||
|
|
6451c94720 | ||
|
|
b208f3a837 | ||
|
|
cadc4ecbff | ||
|
|
7c9e79aa6e | ||
|
|
b20458faa0 | ||
|
|
f28b14e686 | ||
|
|
5c3dc99d82 | ||
|
|
55e977964a | ||
|
|
7a430fdfd0 | ||
|
|
dab935934e | ||
|
|
5d3964f4b6 | ||
|
|
26cf7a7003 | ||
|
|
0a1cd586c0 | ||
|
|
d5165a3388 | ||
|
|
81406effc8 | ||
|
|
cada51d711 | ||
|
|
a9ee94a21b | ||
|
|
af65130fa1 | ||
|
|
a876a4b400 | ||
|
|
016f949eba | ||
|
|
fe34412116 | ||
|
|
dcef517081 | ||
|
|
c228d46eaf | ||
|
|
250de8367d | ||
|
|
01be812580 | ||
|
|
cbc2663a6c | ||
|
|
dd89b991cf | ||
|
|
ee106a3aa1 | ||
|
|
a5d0ec380f | ||
|
|
28efddc033 | ||
|
|
756b98bf32 | ||
|
|
1626f23369 | ||
|
|
655fb40414 | ||
|
|
a083d58c31 | ||
|
|
6a749bcfb1 | ||
|
|
35cf0d50cd | ||
|
|
a65875a7c9 | ||
|
|
4f776ec9cb | ||
|
|
c65bbf50a3 | ||
|
|
c3c6cf76ca | ||
|
|
b565d53bf8 | ||
|
|
f41a26af82 | ||
|
|
53fa67da1c | ||
|
|
1b2840bfdb | ||
|
|
9179318680 | ||
|
|
7f046f4782 | ||
|
|
aab40aafd0 | ||
|
|
9b8a995b56 | ||
|
|
0283ec60df | ||
|
|
716ccb9d85 | ||
|
|
a93c420fc7 | ||
|
|
a4f295906f | ||
|
|
d5cd72d2fd | ||
|
|
318a460d43 | ||
|
|
c8549fc46d | ||
|
|
302e80397a | ||
|
|
f831585e63 | ||
|
|
a195406157 | ||
|
|
3c494b663f | ||
|
|
3ecf27411b | ||
|
|
e51b85d85f | ||
|
|
b72c8748a2 | ||
|
|
3bd15375ec | ||
|
|
05e7eee563 | ||
|
|
661e8a699e | ||
|
|
e5f96c8766 | ||
|
|
22129376c1 | ||
|
|
7a5d5358b9 | ||
|
|
65af83cdbe | ||
|
|
61d17aeb43 | ||
|
|
87b73e0fc8 | ||
|
|
6d9d61dd3a | ||
|
|
66b4af0125 | ||
|
|
aaf76c5759 | ||
|
|
6a53e1ac6b | ||
|
|
8ad69bc3f3 | ||
|
|
00ac706ad8 | ||
|
|
899891d1a3 | ||
|
|
80e1289bf0 | ||
|
|
9b7eef1fe3 | ||
|
|
dceef04330 | ||
|
|
5fb1ef2871 | ||
|
|
44b34e10f6 | ||
|
|
0112583599 | ||
|
|
77a9508a65 | ||
|
|
cace644c0e | ||
|
|
d526784e05 | ||
|
|
5b554b5f44 | ||
|
|
06a0cc79e5 | ||
|
|
278a728906 | ||
|
|
79e042b590 | ||
|
|
57e3674bdd | ||
|
|
7441b2e72b | ||
|
|
105bde609d | ||
|
|
1f25e851bc | ||
|
|
c54b59f8b7 | ||
|
|
8dcdeb307c | ||
|
|
3eb4c31f6f | ||
|
|
b0785c2931 | ||
|
|
0fdf92a4e3 | ||
|
|
5f5d777691 | ||
|
|
2169c5adb4 | ||
|
|
38ef081b68 | ||
|
|
3fdc70d227 | ||
|
|
8df8cb6417 | ||
|
|
7b3f03cb67 | ||
|
|
42c2996cda | ||
|
|
779fd40e4a | ||
|
|
03c1b24665 | ||
|
|
6fc8feb510 | ||
|
|
deb0c3b8a3 | ||
|
|
2364c383fa | ||
|
|
ce8ce02ef8 | ||
|
|
ff835044e2 | ||
|
|
5e332ad592 | ||
|
|
fb88905a99 | ||
|
|
5d3e39325e | ||
|
|
058b1394f5 | ||
|
|
de183a3b75 | ||
|
|
28a8f75d83 | ||
|
|
2e9b937082 | ||
|
|
61d476d4b6 | ||
|
|
02a59d2091 | ||
|
|
007a24b76c | ||
|
|
672ae1c0ce | ||
|
|
f7829bd91c | ||
|
|
3736a0581e | ||
|
|
6f747e9869 | ||
|
|
b31fc2bb17 | ||
|
|
247536c841 | ||
|
|
fd4a18d490 | ||
|
|
a2da4c32f5 | ||
|
|
a3b5ce8a93 | ||
|
|
612563e0fe | ||
|
|
904e2f5020 | ||
|
|
c303922fe9 | ||
|
|
9a8ad86fd7 | ||
|
|
0461c0a070 | ||
|
|
6ad2d6b207 | ||
|
|
45eebd0b85 | ||
|
|
d6132a7645 | ||
|
|
3462c3dc06 | ||
|
|
bc19656218 | ||
|
|
09cc5cf219 | ||
|
|
dd466e7d54 | ||
|
|
368205ab37 | ||
|
|
9821c1a5f9 | ||
|
|
d3a422ba6e | ||
|
|
aaf00c5449 | ||
|
|
a9a4287f4d | ||
|
|
e1f43668e7 | ||
|
|
3b34198a6f | ||
|
|
49ab4faa2b | ||
|
|
54854d4a3a | ||
|
|
45295c87bc | ||
|
|
0dcd40da74 | ||
|
|
a510824ee4 | ||
|
|
7465ba08d3 | ||
|
|
8dca3b7307 | ||
|
|
51a02e0822 | ||
|
|
a07961f561 | ||
|
|
4e26b448e9 | ||
|
|
b5e57e0024 | ||
|
|
b74489d477 | ||
|
|
475001a591 | ||
|
|
f9e0d1c5c3 | ||
|
|
23ed477c44 | ||
|
|
6427d82103 | ||
|
|
436209fa82 | ||
|
|
9d66bd7632 | ||
|
|
0b0ce28a8a | ||
|
|
bdcbf442bf | ||
|
|
15d8701d77 | ||
|
|
c9cf0ab0f5 | ||
|
|
ee32bc6f67 | ||
|
|
20301b3da4 | ||
|
|
c2177b122c | ||
|
|
59e172adb3 | ||
|
|
359b3a5c3a | ||
|
|
522c1e33b0 | ||
|
|
9f4334c1c1 | ||
|
|
7ff5c4b996 | ||
|
|
298108e7ed | ||
|
|
1b1499b94c | ||
|
|
ae3bfbad46 | ||
|
|
d8a61e4df7 | ||
|
|
82b5cc0208 | ||
|
|
91623e6241 | ||
|
|
4af5c63d46 | ||
|
|
1c2f56c672 | ||
|
|
08b0a74035 | ||
|
|
4c8725641d | ||
|
|
b91cd816c8 | ||
|
|
3cf03f73ca | ||
|
|
f9a2fba9ab | ||
|
|
55792af45f | ||
|
|
04cea6497d | ||
|
|
e054a75533 | ||
|
|
834f245953 | ||
|
|
ef9dfeb2d1 | ||
|
|
e6eda9a776 | ||
|
|
98bcbbad78 | ||
|
|
d9f0e42397 | ||
|
|
0a26a05500 | ||
|
|
8a404e2d67 | ||
|
|
31f9f620fe | ||
|
|
2e725894c6 | ||
|
|
a4b2742095 | ||
|
|
2af6d0439e | ||
|
|
56ddeddfaf | ||
|
|
276d786ed9 | ||
|
|
7689b5b9d0 | ||
|
|
fe43dad724 | ||
|
|
ce2d43c1b5 | ||
|
|
a28883d9ad | ||
|
|
45bac7b579 | ||
|
|
86d7201a99 | ||
|
|
e4e6ba52c4 | ||
|
|
6bb4b0ef8b | ||
|
|
e0416b8343 | ||
|
|
f8a1b652bc | ||
|
|
ccf40a29c1 | ||
|
|
f7611b8a1f | ||
|
|
28ed7b9704 | ||
|
|
493a8b28a5 | ||
|
|
6c3ee189d1 | ||
|
|
32ec272b6d | ||
|
|
4c8c0cce93 | ||
|
|
8fc7ba81cc | ||
|
|
15048a1d82 | ||
|
|
5b2b1a47f8 | ||
|
|
f3764c539e | ||
|
|
3852ff760c | ||
|
|
b67fbdff8f | ||
|
|
916b4d2c2f | ||
|
|
0e263f5602 | ||
|
|
af9b04e7ad | ||
|
|
3c815b31fe | ||
|
|
894dffe6ff | ||
|
|
dbbe37b8c1 | ||
|
|
ce712b8f30 | ||
|
|
c17ea8d26d | ||
|
|
913fa2eb44 | ||
|
|
12c873d3e4 | ||
|
|
1844c27699 | ||
|
|
164c48c018 | ||
|
|
2ac8833532 | ||
|
|
9694b76bf2 | ||
|
|
6556e278c6 | ||
|
|
7c9ddf23e0 | ||
|
|
1a9e89cb8d | ||
|
|
224d313a05 | ||
|
|
6d53a2b914 | ||
|
|
47c53efbaa | ||
|
|
57ef2b6ee9 | ||
|
|
c7296b9a05 | ||
|
|
6a5d61ce3c | ||
|
|
297e85c0f1 | ||
|
|
e887f199e0 | ||
|
|
3a59d2cea3 | ||
|
|
e7bd42b07a | ||
|
|
58bb633dc0 | ||
|
|
3397bafb4a | ||
|
|
b9248d774f | ||
|
|
cc256f0bb3 | ||
|
|
763a09c5aa | ||
|
|
e3b060b3e5 | ||
|
|
07987bc97c | ||
|
|
b59c238a83 | ||
|
|
0791667e33 | ||
|
|
9dfa5a8d9e | ||
|
|
91ffd43483 | ||
|
|
3d0bdf694c | ||
|
|
fa751e022e | ||
|
|
b5c6e05ea0 | ||
|
|
1f6c9a3034 | ||
|
|
cc2a478afc | ||
|
|
6c209395aa | ||
|
|
1dab8a1008 | ||
|
|
5231f04b27 | ||
|
|
c7258e9c9e | ||
|
|
4facdaafc3 | ||
|
|
22a1f905e9 | ||
|
|
5190f65321 | ||
|
|
0417a36693 | ||
|
|
d42b860b8d | ||
|
|
0335832574 | ||
|
|
c5168be5d7 | ||
|
|
b9f287ea52 | ||
|
|
c29a75c9df | ||
|
|
28f98ecbf0 | ||
|
|
4e8c8ced0f | ||
|
|
e18d621508 | ||
|
|
5baef32925 | ||
|
|
40399d3505 | ||
|
|
cc8ca29980 | ||
|
|
e2405e2d00 | ||
|
|
1cba9bd634 | ||
|
|
d6db8c6216 | ||
|
|
e58e928af4 | ||
|
|
38817a8bb5 | ||
|
|
646c519dc0 | ||
|
|
c3e842fc4c | ||
|
|
cb501f9f38 | ||
|
|
ab57984c04 | ||
|
|
7eb7737095 | ||
|
|
a8dc2bbd25 | ||
|
|
bb838edb2f | ||
|
|
bfc5811fdc | ||
|
|
1f8f44b26c | ||
|
|
74b777612e | ||
|
|
ea4457878c | ||
|
|
1f3fb08086 | ||
|
|
702ca6af6e | ||
|
|
225a38b68a | ||
|
|
de756246e7 | ||
|
|
de67d5fe6d | ||
|
|
40332972ca | ||
|
|
47292301e7 | ||
|
|
7a5a21dacc | ||
|
|
04aaeef41d | ||
|
|
5a0bad4224 | ||
|
|
07f167eed3 | ||
|
|
6729c38504 | ||
|
|
cf5d2c46f5 | ||
|
|
49e928273d | ||
|
|
b34aa49ceb | ||
|
|
00bbfbb20c | ||
|
|
f5dbd06b32 | ||
|
|
ca120a3f04 | ||
|
|
9bcd7c2fec | ||
|
|
7f2abce0d4 | ||
|
|
b7036ee04f | ||
|
|
36d25230e6 | ||
|
|
d298a327b5 | ||
|
|
8162166037 | ||
|
|
e2b452c1f4 | ||
|
|
dbcf8de808 | ||
|
|
07893af4c5 | ||
|
|
2070231553 | ||
|
|
5b1971f1ef | ||
|
|
988bb4b365 | ||
|
|
64bfddc3a7 | ||
|
|
2a0397c1b2 | ||
|
|
decd9ac9fd | ||
|
|
a181afc699 | ||
|
|
a6db5788f6 | ||
|
|
d37e7cd513 | ||
|
|
6dd64214c2 | ||
|
|
96d3e0fd07 | ||
|
|
ac398b0e50 | ||
|
|
3f1f0657f6 | ||
|
|
abae0c8d21 | ||
|
|
892a599999 | ||
|
|
acbf69fdb6 | ||
|
|
566e886887 | ||
|
|
ae05e30eac | ||
|
|
310998435c | ||
|
|
647265bfd3 | ||
|
|
76af708b1f | ||
|
|
deb606ef59 | ||
|
|
721b294842 | ||
|
|
f40418cf9a | ||
|
|
b12dbd9f6a | ||
|
|
6087feef11 | ||
|
|
e7d652f208 | ||
|
|
51c3dd4cb1 | ||
|
|
8cf35658bd | ||
|
|
ee2b252418 | ||
|
|
45d320a434 | ||
|
|
6695f76c5f | ||
|
|
76067ad5d2 | ||
|
|
15b0729181 | ||
|
|
23d30d9ea6 | ||
|
|
012e0abd22 | ||
|
|
225ee5072e | ||
|
|
384add2571 | ||
|
|
bf25a637c8 | ||
|
|
05c3161112 | ||
|
|
0fb6393510 | ||
|
|
3449cb1c73 | ||
|
|
d73cee75cf | ||
|
|
4350ac39f5 | ||
|
|
6530322582 | ||
|
|
d1f8f1f736 | ||
|
|
764106fe93 | ||
|
|
4a0c231377 | ||
|
|
20b7423e60 | ||
|
|
296832a99f | ||
|
|
47281b5e61 | ||
|
|
f6dcc4a550 | ||
|
|
cb9530157e | ||
|
|
d21dfd48d8 | ||
|
|
066d950c17 | ||
|
|
2ad4d6a45b | ||
|
|
5f001699f7 | ||
|
|
a6b93eb0af | ||
|
|
9479ed3f91 | ||
|
|
8872100508 | ||
|
|
3b90b4ffa4 | ||
|
|
da78942b0b | ||
|
|
3e0cdfa6ad | ||
|
|
31f38561ac | ||
|
|
4d64b38dad | ||
|
|
9e89160e91 | ||
|
|
88e1488e52 | ||
|
|
e129d30002 | ||
|
|
12da98e683 |
286
.travis.yml
Normal file
286
.travis.yml
Normal file
@@ -0,0 +1,286 @@
|
||||
# Copyright 2016 Edward Diener
|
||||
# Copyright 2017 Cromwell D. Enage
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
dist: xenial
|
||||
language: cpp
|
||||
|
||||
python: "2.7"
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /feature\/.*/
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- BOGUS_JOB=true
|
||||
|
||||
matrix:
|
||||
|
||||
exclude:
|
||||
- env: BOGUS_JOB=true
|
||||
|
||||
include:
|
||||
- os: linux
|
||||
compiler: g++-4.4
|
||||
env: TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98,0x
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.4
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.6
|
||||
env: TOOLSET=gcc COMPILER=g++-4.6 CXXSTD=03,0x
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z CXXSTD_DIALECT=cxxstd-dialect=gnu
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: g++-7
|
||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: g++-7
|
||||
env: TOOLSET=gcc COMPILER=g++-7 CXXSTD=03,11,14,17 CXXSTD_DIALECT=cxxstd-dialect=gnu
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-8
|
||||
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.5
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.6
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.7
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.8
|
||||
|
||||
- os: linux
|
||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-precise-3.9
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-4.0
|
||||
env: TOOLSET=clang COMPILER=clang++-4.0 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-4.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-xenial-4.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-5.0
|
||||
env: TOOLSET=clang COMPILER=clang++-5.0 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-5.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-xenial-5.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-6.0
|
||||
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,1z,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-6.0
|
||||
- libc6-dbg
|
||||
- libc++-dev
|
||||
- libstdc++-8-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-xenial-6.0
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-7
|
||||
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=14,1z,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-7
|
||||
- libc6-dbg
|
||||
- libc++-dev
|
||||
- libstdc++-8-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-xenial-7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-8
|
||||
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=14,1z,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-8
|
||||
- libc6-dbg
|
||||
- libc++-dev
|
||||
- libstdc++-8-dev
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-xenial-8
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
|
||||
osx_image: xcode7.3
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
|
||||
osx_image: xcode8.3
|
||||
|
||||
- os: osx
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
|
||||
osx_image: xcode9.4.1
|
||||
|
||||
install:
|
||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||
- cd ..
|
||||
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init tools/boostdep
|
||||
- git submodule update --init libs/parameter_python
|
||||
- git submodule update --init tools/boost_install
|
||||
- git submodule update --init libs/headers
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/parameter
|
||||
- python tools/boostdep/depinst/depinst.py parameter
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
|
||||
script:
|
||||
- |-
|
||||
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||
- ./b2 --verbose-test libs/config/test//config_info toolset=$TOOLSET cxxstd=$CXXSTD || true
|
||||
- cd libs/parameter/test
|
||||
- ../../../b2 -j`(nproc || sysctl -n hw.ncpu) 2> /dev/null` toolset=$TOOLSET cxxstd=$CXXSTD $CXXSTD_DIALECT
|
||||
- cd ../../..
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: always
|
||||
36
CMakeLists.txt
Normal file
36
CMakeLists.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
# Copyright 2019 Mike Dev
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
|
||||
#
|
||||
# NOTE: CMake support for Boost.Parameter is currently experimental at best
|
||||
# and the interface is likely to change in the future
|
||||
|
||||
cmake_minimum_required( VERSION 3.5 )
|
||||
project( BoostParameter LANGUAGES CXX)
|
||||
|
||||
option(BOOST_PARAMETER_INCLUDE_TESTS OFF "Include Boost.Parameter tests")
|
||||
|
||||
add_library( boost_parameter INTERFACE )
|
||||
add_library( Boost::parameter ALIAS boost_parameter )
|
||||
|
||||
target_include_directories( boost_parameter INTERFACE include )
|
||||
|
||||
target_link_libraries( boost_parameter
|
||||
INTERFACE
|
||||
Boost::config
|
||||
Boost::core
|
||||
Boost::function
|
||||
Boost::fusion
|
||||
# TODO: we only need mp11 or mpl
|
||||
Boost::mp11
|
||||
Boost::mpl
|
||||
Boost::optional
|
||||
Boost::preprocessor
|
||||
Boost::type_traits
|
||||
Boost::utility
|
||||
)
|
||||
|
||||
if(BOOST_PARAMETER_INCLUDE_TESTS)
|
||||
enable_testing()
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
69
appveyor.yml
Normal file
69
appveyor.yml
Normal file
@@ -0,0 +1,69 @@
|
||||
# Copyright 2017 Edward Diener
|
||||
# Copyright 2017 Cromwell D. Enage
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
version: 1.0.{build}-{branch}
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- ARGS: --toolset=gcc address-model=32
|
||||
PATH: C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
|
||||
- ARGS: --toolset=gcc address-model=32 linkflags=-Wl,-allow-multiple-definition
|
||||
PATH: C:\MinGW\bin;%PATH%
|
||||
- ARGS: --toolset=gcc address-model=64
|
||||
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
|
||||
- ARGS: --toolset=gcc address-model=64 cxxflags=-std=gnu++1z
|
||||
PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH%
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ARGS: --toolset=msvc-9.0 address-model=32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ARGS: --toolset=msvc-10.0 address-model=32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ARGS: --toolset=msvc-11.0 address-model=32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ARGS: --toolset=msvc-12.0 address-model=32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ARGS: --toolset=msvc-12.0 address-model=64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ARGS: --toolset=msvc-14.0 address-model=32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ARGS: --toolset=msvc-14.0 address-model=64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
ARGS: --toolset=msvc-14.0 address-model=64 cxxflags=-std:c++latest
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ARGS: --toolset=msvc-14.1 address-model=32
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ARGS: --toolset=msvc-14.1 address-model=64
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
- git clone -b %APPVEYOR_REPO_BRANCH% https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init tools/boostdep
|
||||
- git submodule update --init libs/parameter_python
|
||||
- git submodule update --init tools/boost_install
|
||||
- git submodule update --init libs/headers
|
||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\parameter
|
||||
- python tools/boostdep/depinst/depinst.py parameter
|
||||
- bootstrap
|
||||
- b2 headers
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- cd libs\parameter\test
|
||||
- ..\..\..\b2 -j%NUMBER_OF_PROCESSORS% --hash %ARGS%
|
||||
- cd ..\..\..
|
||||
17
doc/Jamfile.v2
Executable file → Normal file
17
doc/Jamfile.v2
Executable file → Normal file
@@ -1,9 +1,12 @@
|
||||
# Copyright David Abrahams 2006. Distributed under the Boost
|
||||
# Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import docutils ;
|
||||
|
||||
import path ;
|
||||
sources = [ path.glob . : *.rst ] ;
|
||||
sources = [ glob *.rst ] ;
|
||||
bases = $(sources:S=) ;
|
||||
|
||||
|
||||
# This is a path relative to the html/ subdirectory where the
|
||||
# generated output will eventually be moved.
|
||||
stylesheet = "--stylesheet=rst.css" ;
|
||||
@@ -13,9 +16,15 @@ for local b in $(bases)
|
||||
html $(b) : $(b).rst :
|
||||
|
||||
#
|
||||
<docutils-html>"-gdt --traceback --trim-footnote-reference-space --footnote-references=superscript "$(stylesheet)
|
||||
<docutils-html>"-gdt --link-stylesheet --traceback --trim-footnote-reference-space --footnote-references=superscript "$(stylesheet)
|
||||
;
|
||||
}
|
||||
|
||||
alias htmls : $(bases) ;
|
||||
stage html : $(bases) ;
|
||||
|
||||
###############################################################################
|
||||
alias boostdoc ;
|
||||
explicit boostdoc ;
|
||||
alias boostrelease : html ;
|
||||
explicit boostrelease ;
|
||||
|
||||
3375
doc/html/index.html
Executable file → Normal file
3375
doc/html/index.html
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
7403
doc/html/reference.html
Executable file → Normal file
7403
doc/html/reference.html
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
13
doc/html/rst.css
Executable file → Normal file
13
doc/html/rst.css
Executable file → Normal file
@@ -1,3 +1,8 @@
|
||||
/* Copyright David Abrahams 2006. Distributed under the Boost
|
||||
Software License, Version 1.0. (See accompanying
|
||||
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
@import "../../../../rst.css";
|
||||
|
||||
div.section div.section div.section dl {
|
||||
@@ -14,8 +19,12 @@ img {
|
||||
}
|
||||
|
||||
span.vellipsis {
|
||||
line-height: 30% ;
|
||||
font-size: 200% ;
|
||||
display: block;
|
||||
width: 5px;
|
||||
height: 22px;
|
||||
background: url("vellipsis.gif");
|
||||
margin-left: 3em;
|
||||
text-indent: -1000px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
BIN
doc/html/vellipsis.gif
Normal file
BIN
doc/html/vellipsis.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 62 B |
3738
doc/index.rst
Executable file → Normal file
3738
doc/index.rst
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
7355
doc/reference.rst
Executable file → Normal file
7355
doc/reference.rst
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
22
include/boost/parameter.hpp
Executable file → Normal file
22
include/boost/parameter.hpp
Executable file → Normal file
@@ -1,16 +1,30 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2005. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright David Abrahams, Daniel Wallin 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See www.boost.org/libs/parameter for documentation.
|
||||
|
||||
#ifndef BOOST_PARAMETER_050401_HPP
|
||||
#define BOOST_PARAMETER_050401_HPP
|
||||
|
||||
#include <boost/parameter/parameters.hpp>
|
||||
#include <boost/parameter/are_tagged_arguments.hpp>
|
||||
#include <boost/parameter/is_argument_pack.hpp>
|
||||
#include <boost/parameter/required.hpp>
|
||||
#include <boost/parameter/optional.hpp>
|
||||
#include <boost/parameter/deduced.hpp>
|
||||
#include <boost/parameter/template_keyword.hpp>
|
||||
#include <boost/parameter/keyword.hpp>
|
||||
#include <boost/parameter/nested_keyword.hpp>
|
||||
#include <boost/parameter/binding.hpp>
|
||||
#include <boost/parameter/value_type.hpp>
|
||||
#include <boost/parameter/macros.hpp>
|
||||
#include <boost/parameter/match.hpp>
|
||||
#include <boost/parameter/name.hpp>
|
||||
#include <boost/parameter/compose.hpp>
|
||||
#include <boost/parameter/preprocessor.hpp>
|
||||
#include <boost/parameter/preprocessor_no_spec.hpp>
|
||||
|
||||
#endif // BOOST_PARAMETER_050401_HPP
|
||||
#endif // include guard
|
||||
|
||||
|
||||
125
include/boost/parameter/are_tagged_arguments.hpp
Normal file
125
include/boost/parameter/are_tagged_arguments.hpp
Normal file
@@ -0,0 +1,125 @@
|
||||
// Copyright Cromwell D. Enage 2018.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_HPP
|
||||
#define BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_HPP
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
template <typename TaggedArg0, typename ...TaggedArgs>
|
||||
struct are_tagged_arguments;
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#include <boost/parameter/aux_/is_tagged_argument.hpp>
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
template <typename TaggedArg0>
|
||||
struct are_tagged_arguments<TaggedArg0>
|
||||
: ::boost::parameter::aux::is_tagged_argument<TaggedArg0>
|
||||
{
|
||||
};
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
template <typename TaggedArg0, typename ...TaggedArgs>
|
||||
struct are_tagged_arguments
|
||||
: ::boost::mpl::if_<
|
||||
::boost::parameter::aux::is_tagged_argument<TaggedArg0>
|
||||
, ::boost::parameter::are_tagged_arguments<TaggedArgs...>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
#define BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_END_Z(z, n, false_t) , false_t>
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/is_tagged_argument.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_BEGIN_Z(z, n, prefix) \
|
||||
::boost::mpl::eval_if< \
|
||||
::boost::parameter::aux::is_tagged_argument<BOOST_PP_CAT(prefix, n)>,
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_OVERLOADS_Z(z, n, prefix) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename prefix)> \
|
||||
struct are_tagged_arguments< \
|
||||
BOOST_PP_ENUM_PARAMS_Z(z, n, prefix) \
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS_Z( \
|
||||
z \
|
||||
, BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, n) \
|
||||
, ::boost::parameter::void_ BOOST_PP_INTERCEPT \
|
||||
) \
|
||||
> : BOOST_PP_CAT(BOOST_PP_REPEAT_, z)( \
|
||||
n \
|
||||
, BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_BEGIN_Z \
|
||||
, prefix \
|
||||
) \
|
||||
::boost::mpl::true_ \
|
||||
BOOST_PP_CAT(BOOST_PP_REPEAT_, z)( \
|
||||
n \
|
||||
, BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_END_Z \
|
||||
, ::boost::mpl::false_ \
|
||||
)::type \
|
||||
{ \
|
||||
};
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
template <
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(
|
||||
BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY)
|
||||
, typename TaggedArg
|
||||
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT
|
||||
)
|
||||
>
|
||||
struct are_tagged_arguments;
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
BOOST_PP_REPEAT_FROM_TO(
|
||||
1
|
||||
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY)
|
||||
, BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_OVERLOADS_Z
|
||||
, TaggedArg
|
||||
)
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#undef BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_OVERLOADS_Z
|
||||
#undef BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_BEGIN_Z
|
||||
#undef BOOST_PARAMETER_ARE_TAGGED_ARGUMENTS_END_Z
|
||||
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
#endif // include guard
|
||||
|
||||
42
include/boost/parameter/aux_/always_true_predicate.hpp
Normal file
42
include/boost/parameter/aux_/always_true_predicate.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
// Copyright Cromwell D. Enage 2019.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_ALWAYS_TRUE_PREDICATE_HPP
|
||||
#define BOOST_PARAMETER_AUX_ALWAYS_TRUE_PREDICATE_HPP
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#endif
|
||||
#else
|
||||
#include <boost/mpl/always.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
struct always_true_predicate
|
||||
{
|
||||
template <typename ...>
|
||||
struct apply
|
||||
{
|
||||
typedef ::boost::mpl::true_ type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename ...>
|
||||
using fn = ::boost::mp11::mp_true;
|
||||
#endif
|
||||
};
|
||||
#else
|
||||
typedef ::boost::mpl::always< ::boost::mpl::true_> always_true_predicate;
|
||||
#endif // BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
1641
include/boost/parameter/aux_/arg_list.hpp
Executable file → Normal file
1641
include/boost/parameter/aux_/arg_list.hpp
Executable file → Normal file
File diff suppressed because it is too large
Load Diff
25
include/boost/parameter/aux_/as_lvalue.hpp
Normal file
25
include/boost/parameter/aux_/as_lvalue.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_AS_LVALUE_HPP
|
||||
#define BOOST_PARAMETER_AUX_AS_LVALUE_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
T const& as_lvalue(T const& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T& as_lvalue(T& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
198
include/boost/parameter/aux_/augment_predicate.hpp
Normal file
198
include/boost/parameter/aux_/augment_predicate.hpp
Normal file
@@ -0,0 +1,198 @@
|
||||
// Copyright Cromwell D. Enage 2018.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUGMENT_PREDICATE_HPP
|
||||
#define BOOST_PARAMETER_AUGMENT_PREDICATE_HPP
|
||||
|
||||
#include <boost/parameter/keyword_fwd.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/type_traits/is_lvalue_reference.hpp>
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename V, typename R, typename Tag>
|
||||
struct augment_predicate_check_consume_ref
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::is_scalar<V>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::consume_reference
|
||||
>
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_lvalue_reference<R>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, boost::mpl::true_
|
||||
>
|
||||
>::type
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename V, typename R, typename Tag>
|
||||
struct augment_predicate_check_out_ref
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_lvalue_reference<R>
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_const<V>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/lambda_tag.hpp>
|
||||
#include <boost/mpl/apply_wrap.hpp>
|
||||
#include <boost/mpl/lambda.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <
|
||||
typename Predicate
|
||||
, typename R
|
||||
, typename Tag
|
||||
, typename T
|
||||
, typename Args
|
||||
>
|
||||
class augment_predicate
|
||||
{
|
||||
typedef typename ::boost::mpl::lambda<
|
||||
Predicate
|
||||
, ::boost::parameter::aux::lambda_tag
|
||||
>::type _actual_predicate;
|
||||
|
||||
public:
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::parameter::aux
|
||||
::augment_predicate_check_consume_ref<T,R,Tag>
|
||||
, ::boost::parameter::aux
|
||||
::augment_predicate_check_out_ref<T,R,Tag>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
, ::boost::mpl::apply_wrap2<_actual_predicate,T,Args>
|
||||
, ::boost::mpl::false_
|
||||
>::type type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename V, typename R, typename Tag>
|
||||
using augment_predicate_check_consume_ref_mp11 = ::boost::mp11::mp_if<
|
||||
::std::is_scalar<V>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::consume_reference
|
||||
>
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_lvalue_reference<R>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
, boost::mp11::mp_true
|
||||
>
|
||||
>;
|
||||
|
||||
template <typename V, typename R, typename Tag>
|
||||
using augment_predicate_check_out_ref_mp11 = ::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_lvalue_reference<R>
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_const<V>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
, ::boost::mp11::mp_false
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
>;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mp11/list.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <
|
||||
typename Predicate
|
||||
, typename R
|
||||
, typename Tag
|
||||
, typename T
|
||||
, typename Args
|
||||
>
|
||||
struct augment_predicate_mp11_impl
|
||||
{
|
||||
using type = ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_if<
|
||||
::boost::parameter::aux
|
||||
::augment_predicate_check_consume_ref_mp11<T,R,Tag>
|
||||
, ::boost::parameter::aux
|
||||
::augment_predicate_check_out_ref_mp11<T,R,Tag>
|
||||
, ::boost::mp11::mp_false
|
||||
>
|
||||
, ::boost::mp11
|
||||
::mp_apply_q<Predicate,::boost::mp11::mp_list<T,Args> >
|
||||
, ::boost::mp11::mp_false
|
||||
>;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/has_nested_template_fn.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <
|
||||
typename Predicate
|
||||
, typename R
|
||||
, typename Tag
|
||||
, typename T
|
||||
, typename Args
|
||||
>
|
||||
using augment_predicate_mp11 = ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::has_nested_template_fn<Predicate>
|
||||
, ::boost::parameter::aux
|
||||
::augment_predicate_mp11_impl<Predicate,R,Tag,T,Args>
|
||||
, ::boost::parameter::aux
|
||||
::augment_predicate<Predicate,R,Tag,T,Args>
|
||||
>;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
#endif // include guard
|
||||
|
||||
12
include/boost/parameter/aux_/cast.hpp
Normal file
12
include/boost/parameter/aux_/cast.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_CAST_060902_HPP
|
||||
#define BOOST_PARAMETER_CAST_060902_HPP
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/function_cast.hpp>
|
||||
|
||||
#endif // include guard
|
||||
|
||||
149
include/boost/parameter/aux_/default.hpp
Executable file → Normal file
149
include/boost/parameter/aux_/default.hpp
Executable file → Normal file
@@ -1,67 +1,100 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef DEFAULT_050329_HPP
|
||||
#define DEFAULT_050329_HPP
|
||||
#ifndef BOOST_PARAMETER_AUX_DEFAULT_HPP
|
||||
#define BOOST_PARAMETER_AUX_DEFAULT_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// A wrapper for the default value passed by the user when resolving
|
||||
// the value of the parameter with the given Keyword
|
||||
template <class Keyword, class Value>
|
||||
struct default_
|
||||
{
|
||||
default_(Value& x)
|
||||
: value(x)
|
||||
{}
|
||||
|
||||
Value& value;
|
||||
};
|
||||
|
||||
//
|
||||
// lazy_default --
|
||||
//
|
||||
// A wrapper for the default value computation function passed by
|
||||
// the user when resolving the value of the parameter with the
|
||||
// given keyword
|
||||
//
|
||||
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
|
||||
// These compilers need a little extra help with overload
|
||||
// resolution; we have empty_arg_list's operator[] accept a base
|
||||
// class to make that overload less preferable.
|
||||
template <class KW, class DefaultComputer>
|
||||
struct lazy_default_base
|
||||
{
|
||||
lazy_default_base(DefaultComputer const& x)
|
||||
: compute_default(x)
|
||||
{}
|
||||
DefaultComputer const& compute_default;
|
||||
};
|
||||
|
||||
template <class KW, class DefaultComputer>
|
||||
struct lazy_default
|
||||
: lazy_default_base<KW,DefaultComputer>
|
||||
{
|
||||
lazy_default(DefaultComputer const & x)
|
||||
: lazy_default_base<KW,DefaultComputer>(x)
|
||||
{}
|
||||
};
|
||||
# define BOOST_PARAMETER_lazy_default_fallback lazy_default_base
|
||||
#else
|
||||
template <class KW, class DefaultComputer>
|
||||
struct lazy_default
|
||||
{
|
||||
lazy_default(const DefaultComputer& x)
|
||||
: compute_default(x)
|
||||
{}
|
||||
DefaultComputer const& compute_default;
|
||||
};
|
||||
# define BOOST_PARAMETER_lazy_default_fallback lazy_default
|
||||
#endif
|
||||
// A wrapper for the default value passed by the user when resolving
|
||||
// the value of the parameter with the given Keyword
|
||||
template <typename Keyword, typename Value>
|
||||
struct default_
|
||||
{
|
||||
inline BOOST_CONSTEXPR default_(Value& x) : value(x)
|
||||
{
|
||||
}
|
||||
|
||||
Value& value;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // DEFAULT_050329_HPP
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// lazy_default -- A wrapper for the default value computation function
|
||||
// passed by the user when resolving the value of the parameter with the
|
||||
// given keyword.
|
||||
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
|
||||
// These compilers need a little extra help with overload resolution;
|
||||
// we have empty_arg_list's operator[] accept a base class
|
||||
// to make that overload less preferable.
|
||||
template <typename KW, typename DefaultComputer>
|
||||
struct lazy_default_base
|
||||
{
|
||||
inline BOOST_CONSTEXPR lazy_default_base(DefaultComputer& x)
|
||||
: compute_default(x)
|
||||
{
|
||||
}
|
||||
|
||||
DefaultComputer& compute_default;
|
||||
};
|
||||
|
||||
template <typename KW, typename DefaultComputer>
|
||||
struct lazy_default
|
||||
: ::boost::parameter::aux::lazy_default_base<KW,DefaultComputer>
|
||||
{
|
||||
inline BOOST_CONSTEXPR lazy_default(DefaultComputer& x)
|
||||
: ::boost::parameter::aux::lazy_default_base<KW,DefaultComputer>(x)
|
||||
{
|
||||
}
|
||||
};
|
||||
#else // !BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
|
||||
template <typename KW, typename DefaultComputer>
|
||||
struct lazy_default
|
||||
{
|
||||
inline BOOST_CONSTEXPR lazy_default(DefaultComputer& x)
|
||||
: compute_default(x)
|
||||
{
|
||||
}
|
||||
|
||||
DefaultComputer& compute_default;
|
||||
};
|
||||
#endif // EDG workarounds needed.
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 300)
|
||||
#define BOOST_PARAMETER_lazy_default_fallback \
|
||||
::boost::parameter::aux::lazy_default_base
|
||||
/**/
|
||||
#else
|
||||
#define BOOST_PARAMETER_lazy_default_fallback \
|
||||
::boost::parameter::aux::lazy_default
|
||||
/**/
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Keyword, typename Value>
|
||||
struct default_r_
|
||||
{
|
||||
inline BOOST_CONSTEXPR default_r_(Value&& x)
|
||||
: value(::std::forward<Value>(x))
|
||||
{
|
||||
}
|
||||
|
||||
Value&& value;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
#endif // include guard
|
||||
|
||||
|
||||
111
include/boost/parameter/aux_/has_nested_template_fn.hpp
Normal file
111
include/boost/parameter/aux_/has_nested_template_fn.hpp
Normal file
@@ -0,0 +1,111 @@
|
||||
// Copyright Cromwell D. Enage 2019.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_HAS_NESTED_TEMPLATE_FN_HPP
|
||||
#define BOOST_PARAMETER_AUX_HAS_NESTED_TEMPLATE_FN_HPP
|
||||
|
||||
#include <boost/parameter/aux_/yesno.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <template <typename ...> class F>
|
||||
struct has_nested_template_fn_variadic
|
||||
{
|
||||
};
|
||||
#else
|
||||
template <template <typename P0, typename P1> class F>
|
||||
struct has_nested_template_fn_arity_2
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
class has_nested_template_fn_impl
|
||||
{
|
||||
template <typename U>
|
||||
static ::boost::parameter::aux::no_tag _check(...);
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename U>
|
||||
static ::boost::parameter::aux::yes_tag
|
||||
_check(
|
||||
::boost::mp11::mp_identity<U> const volatile*
|
||||
, ::boost::parameter::aux::has_nested_template_fn_variadic<
|
||||
U::template fn
|
||||
>* = BOOST_PARAMETER_AUX_PP_NULLPTR
|
||||
);
|
||||
#else
|
||||
template <typename U>
|
||||
static BOOST_CONSTEXPR ::boost::parameter::aux::yes_tag
|
||||
_check(
|
||||
::boost::mpl::identity<U> const volatile*
|
||||
, ::boost::parameter::aux::has_nested_template_fn_arity_2<
|
||||
U::template fn
|
||||
>* = BOOST_PARAMETER_AUX_PP_NULLPTR
|
||||
);
|
||||
#endif
|
||||
|
||||
public:
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = ::boost::mp11::mp_bool<
|
||||
#else
|
||||
typedef ::boost::mpl::bool_<
|
||||
#endif
|
||||
sizeof(
|
||||
::boost::parameter::aux::has_nested_template_fn_impl<T>
|
||||
::template _check<T>(
|
||||
static_cast<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_identity<T> const volatile*
|
||||
#else
|
||||
::boost::mpl::identity<T> const volatile*
|
||||
#endif
|
||||
>(BOOST_PARAMETER_AUX_PP_NULLPTR)
|
||||
)
|
||||
) == sizeof(::boost::parameter::aux::yes_tag)
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
>;
|
||||
#else
|
||||
> type;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using has_nested_template_fn = typename ::boost::parameter::aux
|
||||
::has_nested_template_fn_impl<typename ::std::remove_const<T>::type>
|
||||
::type;
|
||||
#else
|
||||
struct has_nested_template_fn
|
||||
: ::boost::parameter::aux::has_nested_template_fn_impl<
|
||||
typename ::boost::remove_const<T>::type
|
||||
>::type
|
||||
{
|
||||
};
|
||||
#endif
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
52
include/boost/parameter/aux_/is_maybe.hpp
Normal file
52
include/boost/parameter/aux_/is_maybe.hpp
Normal file
@@ -0,0 +1,52 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2010.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_IS_MAYBE_050329_HPP
|
||||
#define BOOST_PARAMETER_IS_MAYBE_050329_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
struct maybe_base
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
using is_maybe = ::std::is_base_of<
|
||||
::boost::parameter::aux::maybe_base
|
||||
, typename ::std::remove_const<T>::type
|
||||
>;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct is_maybe
|
||||
: ::boost::mpl::if_<
|
||||
::boost::is_base_of<
|
||||
::boost::parameter::aux::maybe_base
|
||||
, typename ::boost::remove_const<T>::type
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
#endif // include guard
|
||||
|
||||
64
include/boost/parameter/aux_/is_placeholder.hpp
Normal file
64
include/boost/parameter/aux_/is_placeholder.hpp
Normal file
@@ -0,0 +1,64 @@
|
||||
// Copyright Cromwell D. Enage 2019.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_IS_PLACEHOLDER_HPP
|
||||
#define BOOST_PARAMETER_AUX_IS_PLACEHOLDER_HPP
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct is_mpl_placeholder
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
: ::boost::mp11::mp_false
|
||||
#else
|
||||
: ::boost::mpl::false_
|
||||
#endif
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/arg_fwd.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <int I>
|
||||
struct is_mpl_placeholder< ::boost::mpl::arg<I> >
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
: ::boost::mp11::mp_true
|
||||
#else
|
||||
: ::boost::mpl::true_
|
||||
#endif
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/bind.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct is_mp11_placeholder : ::boost::mp11::mp_false
|
||||
{
|
||||
};
|
||||
|
||||
template < ::std::size_t I>
|
||||
struct is_mp11_placeholder< ::boost::mp11::mp_arg<I> >
|
||||
: ::boost::mp11::mp_true
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
#endif // include guard
|
||||
|
||||
95
include/boost/parameter/aux_/is_tagged_argument.hpp
Normal file
95
include/boost/parameter/aux_/is_tagged_argument.hpp
Normal file
@@ -0,0 +1,95 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_IS_TAGGED_ARGUMENT_HPP
|
||||
#define BOOST_PARAMETER_IS_TAGGED_ARGUMENT_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
struct tagged_argument_base
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) || \
|
||||
(0 < BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// This metafunction identifies tagged_argument specializations
|
||||
// and their derived classes.
|
||||
template <typename T>
|
||||
struct is_tagged_argument
|
||||
: ::boost::mpl::if_<
|
||||
// Cannot use is_convertible<> to check if T is derived from
|
||||
// tagged_argument_base. -- Cromwell D. Enage
|
||||
::boost::is_base_of<
|
||||
::boost::parameter::aux::tagged_argument_base
|
||||
, typename ::boost::remove_const<
|
||||
typename ::boost::remove_reference<T>::type
|
||||
>::type
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#else // no perfect forwarding support and no exponential overloads
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/is_lvalue_reference.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct is_tagged_argument_aux
|
||||
: ::boost::is_convertible<
|
||||
T*
|
||||
, ::boost::parameter::aux::tagged_argument_base const*
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
// This metafunction identifies tagged_argument specializations
|
||||
// and their derived classes.
|
||||
template <typename T>
|
||||
struct is_tagged_argument
|
||||
: ::boost::mpl::if_<
|
||||
::boost::is_lvalue_reference<T>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::parameter::aux::is_tagged_argument_aux<T>
|
||||
>::type
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // perfect forwarding support, or exponential overloads
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
using is_tagged_argument_mp11 = ::std::is_base_of<
|
||||
::boost::parameter::aux::tagged_argument_base
|
||||
, typename ::std::remove_const<
|
||||
typename ::std::remove_reference<T>::type
|
||||
>::type
|
||||
>;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
#endif // include guard
|
||||
|
||||
16
include/boost/parameter/aux_/lambda_tag.hpp
Normal file
16
include/boost/parameter/aux_/lambda_tag.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_LAMBDA_TAG_HPP
|
||||
#define BOOST_PARAMETER_AUX_LAMBDA_TAG_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Tag type passed to MPL lambda.
|
||||
struct lambda_tag;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
151
include/boost/parameter/aux_/maybe.hpp
Normal file
151
include/boost/parameter/aux_/maybe.hpp
Normal file
@@ -0,0 +1,151 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
//
|
||||
// 2009.10.21 TDS remove depenency on boost::python::detail::referent_storage
|
||||
//
|
||||
#ifndef BOOST_PARAMETER_MAYBE_091021_HPP
|
||||
#define BOOST_PARAMETER_MAYBE_091021_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct referent_size;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct referent_size<T&>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(::std::size_t, value = sizeof(T));
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/type_traits/aligned_storage.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// A metafunction returning a POD type which can store U, where T == U&.
|
||||
// If T is not a reference type, returns a POD which can store T.
|
||||
template <typename T>
|
||||
struct referent_storage
|
||||
: ::boost::aligned_storage<
|
||||
::boost::parameter::aux::referent_size<T>::value
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/is_maybe.hpp>
|
||||
#include <boost/optional/optional.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <type_traits>
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/type_traits/add_lvalue_reference.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#endif
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct maybe : ::boost::parameter::aux::maybe_base
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typedef typename ::std::add_lvalue_reference<
|
||||
typename ::std::add_const<T>::type
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typedef typename ::boost::add_lvalue_reference<
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
T const
|
||||
#else
|
||||
typename ::boost::add_const<T>::type
|
||||
#endif
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
>::type reference;
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typedef typename ::std::remove_cv<
|
||||
typename ::std::remove_reference<reference>::type
|
||||
#else
|
||||
typedef typename ::boost::remove_cv<
|
||||
BOOST_DEDUCED_TYPENAME ::boost::remove_reference<reference>::type
|
||||
#endif
|
||||
>::type non_cv_value;
|
||||
|
||||
inline explicit maybe(T value_) : value(value_), constructed(false)
|
||||
{
|
||||
}
|
||||
|
||||
inline maybe() : value(), constructed(false)
|
||||
{
|
||||
}
|
||||
|
||||
~maybe()
|
||||
{
|
||||
if (this->constructed)
|
||||
{
|
||||
this->destroy();
|
||||
}
|
||||
}
|
||||
|
||||
inline reference construct(reference value_) const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
reference construct2(U const& value_) const
|
||||
{
|
||||
new (this->m_storage.address()) non_cv_value(value_);
|
||||
this->constructed = true;
|
||||
return *reinterpret_cast<non_cv_value*>(
|
||||
this->m_storage.address()
|
||||
);
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
inline reference construct(U const& value_) const
|
||||
{
|
||||
return this->construct2(value_);
|
||||
}
|
||||
|
||||
void destroy()
|
||||
{
|
||||
reinterpret_cast<non_cv_value*>(
|
||||
this->m_storage.address()
|
||||
)->~non_cv_value();
|
||||
}
|
||||
|
||||
typedef reference(
|
||||
::boost::parameter::aux::maybe<T>::*safe_bool
|
||||
)() const;
|
||||
|
||||
inline operator safe_bool() const
|
||||
{
|
||||
return this->value ? &::boost::parameter::aux::maybe<T>::get : 0;
|
||||
}
|
||||
|
||||
inline reference get() const
|
||||
{
|
||||
return this->value.get();
|
||||
}
|
||||
|
||||
private:
|
||||
::boost::optional<T> value;
|
||||
mutable bool constructed;
|
||||
mutable typename ::boost::parameter::aux
|
||||
::referent_storage<reference>::type m_storage;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
93
include/boost/parameter/aux_/name.hpp
Normal file
93
include/boost/parameter/aux_/name.hpp
Normal file
@@ -0,0 +1,93 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_NAME_HPP
|
||||
#define BOOST_PARAMETER_AUX_NAME_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
struct name_tag_base
|
||||
{
|
||||
};
|
||||
|
||||
template <typename Tag>
|
||||
struct name_tag
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct is_name_tag : ::boost::mpl::false_
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/value_type.hpp>
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE) && \
|
||||
!BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
#include <boost/parameter/aux_/lambda_tag.hpp>
|
||||
#include <boost/mpl/lambda.hpp>
|
||||
#include <boost/mpl/bind.hpp>
|
||||
#include <boost/mpl/quote.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template <typename T>
|
||||
struct lambda<
|
||||
T
|
||||
, typename ::boost::enable_if<
|
||||
::boost::parameter::aux::is_name_tag<T>
|
||||
, ::boost::parameter::aux::lambda_tag
|
||||
>::type
|
||||
>
|
||||
{
|
||||
typedef ::boost::mpl::true_ is_le;
|
||||
typedef ::boost::mpl::bind3<
|
||||
::boost::mpl::quote3< ::boost::parameter::value_type>
|
||||
, ::boost::mpl::arg<2>
|
||||
, T
|
||||
, void
|
||||
> result_;
|
||||
typedef result_ type;
|
||||
};
|
||||
}} // namespace boost::mpl
|
||||
|
||||
#endif // SFINAE enabled, not Borland.
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(tag) \
|
||||
::boost::parameter::value_type< \
|
||||
::boost::mpl::_2,tag,::boost::parameter::void_ \
|
||||
>
|
||||
/**/
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#define BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_VALUE(name, tag) \
|
||||
template <typename ArgumentPack> \
|
||||
using name = typename ::boost::parameter \
|
||||
::value_type<ArgumentPack,tag,::boost::parameter::void_>::type
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/binding.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_BINDING(name, tag) \
|
||||
template <typename ArgumentPack> \
|
||||
using name = typename ::boost::parameter \
|
||||
::binding<ArgumentPack,tag,::boost::parameter::void_>::type
|
||||
/**/
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
#endif // include guard
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 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)
|
||||
|
||||
// This file generates overloads in this format:
|
||||
//
|
||||
// template<class A0, class A1>
|
||||
// typename mpl::apply_wrap1<
|
||||
// aux::make_arg_list<
|
||||
// PS0,A0
|
||||
// , aux::make_arg_list<
|
||||
// PS1,A1
|
||||
// , mpl::identity<aux::empty_arg_list>
|
||||
// >
|
||||
// >
|
||||
// , unnamed_list
|
||||
// >::type
|
||||
// operator()(A0 const& a0, A1 const& a1) const
|
||||
// {
|
||||
// typedef typename mpl::apply_wrap1<
|
||||
// aux::make_arg_list<
|
||||
// PS0,A0
|
||||
// , aux::make_arg_list<
|
||||
// PS1,A1
|
||||
// , mpl::identity<aux::empty_arg_list>
|
||||
// >
|
||||
// >
|
||||
// >::type arg_tuple;
|
||||
//
|
||||
// return arg_tuple(
|
||||
// a0
|
||||
// , a1
|
||||
// , aux::void_()
|
||||
// ...
|
||||
// );
|
||||
// }
|
||||
//
|
||||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
# error Boost.Parameters - do not include this file!
|
||||
#endif
|
||||
|
||||
#define N BOOST_PP_ITERATION()
|
||||
|
||||
#define BOOST_PARAMETER_open_list(z, n, text) \
|
||||
aux::make_arg_list< \
|
||||
BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
|
||||
|
||||
#define BOOST_PARAMETER_close_list(z, n, text) >
|
||||
|
||||
#define BOOST_PARAMETER_arg_list(n) \
|
||||
mpl::apply_wrap1< \
|
||||
BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \
|
||||
, mpl::always<aux::empty_arg_list> \
|
||||
BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _) \
|
||||
, unnamed_list>
|
||||
|
||||
template<BOOST_PP_ENUM_PARAMS(N, class A)>
|
||||
typename BOOST_PARAMETER_arg_list(N)::type
|
||||
operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a)) const
|
||||
{
|
||||
typedef typename BOOST_PARAMETER_arg_list(N)::type arg_tuple;
|
||||
|
||||
return arg_tuple(
|
||||
BOOST_PP_ENUM_PARAMS(N, a)
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS(
|
||||
BOOST_PP_SUB(BOOST_PARAMETER_MAX_ARITY, N)
|
||||
, aux::void_() BOOST_PP_INTERCEPT
|
||||
));
|
||||
}
|
||||
|
||||
#undef BOOST_PARAMETER_arg_list
|
||||
#undef BOOST_PARAMETER_open_list
|
||||
#undef BOOST_PARAMETER_close_list
|
||||
#undef N
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_AS_PARAMETER_REQUIREMENTS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_AS_PARAMETER_REQUIREMENTS_HPP
|
||||
|
||||
#include <boost/parameter/aux_/pack/parameter_requirements.hpp>
|
||||
#include <boost/parameter/aux_/pack/tag_type.hpp>
|
||||
#include <boost/parameter/aux_/pack/predicate.hpp>
|
||||
#include <boost/parameter/deduced.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Converts a ParameterSpec into a specialization of
|
||||
// parameter_requirements. We need to do this in order to get the
|
||||
// tag_type into the type in a way that can be conveniently matched
|
||||
// by a satisfies(...) member function in arg_list.
|
||||
template <typename ParameterSpec>
|
||||
struct as_parameter_requirements
|
||||
{
|
||||
typedef ::boost::parameter::aux::parameter_requirements<
|
||||
typename ::boost::parameter::aux::tag_type<ParameterSpec>::type
|
||||
, typename ::boost::parameter::aux::predicate<ParameterSpec>::type
|
||||
, ::boost::parameter::aux::has_default<ParameterSpec>
|
||||
> type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
217
include/boost/parameter/aux_/pack/deduce_tag.hpp
Normal file
217
include/boost/parameter/aux_/pack/deduce_tag.hpp
Normal file
@@ -0,0 +1,217 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_DEDUCE_TAG_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_DEDUCE_TAG_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <
|
||||
typename Argument
|
||||
, typename ArgumentPack
|
||||
, typename DeducedArgs
|
||||
, typename UsedArgs
|
||||
, typename TagFn
|
||||
, typename EmitsErrors
|
||||
>
|
||||
struct deduce_tag;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/lambda_tag.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
#include <boost/mpl/apply_wrap.hpp>
|
||||
#include <boost/mpl/lambda.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Predicate, typename Argument, typename ArgumentPack>
|
||||
struct deduce_tag_condition_mpl
|
||||
: ::boost::mpl::apply_wrap2<
|
||||
typename ::boost::mpl::lambda<
|
||||
Predicate
|
||||
, ::boost::parameter::aux::lambda_tag
|
||||
>::type
|
||||
, Argument
|
||||
, ArgumentPack
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/has_nested_template_fn.hpp>
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Predicate, typename Argument, typename ArgumentPack>
|
||||
struct deduce_tag_condition_mp11
|
||||
{
|
||||
using type = ::boost::mp11::mp_apply_q<
|
||||
Predicate
|
||||
, ::boost::mp11::mp_list<Argument,ArgumentPack>
|
||||
>;
|
||||
};
|
||||
|
||||
template <typename Predicate, typename Argument, typename ArgumentPack>
|
||||
using deduce_tag_condition = ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::has_nested_template_fn<Predicate>
|
||||
, ::boost::parameter::aux
|
||||
::deduce_tag_condition_mp11<Predicate,Argument,ArgumentPack>
|
||||
, ::boost::parameter::aux
|
||||
::deduce_tag_condition_mpl<Predicate,Argument,ArgumentPack>
|
||||
>;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
#include <boost/parameter/aux_/set.hpp>
|
||||
#include <boost/parameter/aux_/pack/tag_type.hpp>
|
||||
#include <boost/parameter/aux_/pack/tag_deduced.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Helper for deduce_tag<...>, below.
|
||||
template <
|
||||
typename Argument
|
||||
, typename ArgumentPack
|
||||
, typename DeducedArgs
|
||||
, typename UsedArgs
|
||||
, typename TagFn
|
||||
, typename EmitsErrors
|
||||
>
|
||||
class deduce_tag0
|
||||
{
|
||||
typedef typename DeducedArgs::spec _spec;
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typedef typename ::boost::parameter::aux::deduce_tag_condition<
|
||||
typename _spec::predicate
|
||||
#else
|
||||
typedef typename ::boost::mpl::apply_wrap2<
|
||||
typename ::boost::mpl::lambda<
|
||||
typename _spec::predicate
|
||||
, ::boost::parameter::aux::lambda_tag
|
||||
>::type
|
||||
#endif
|
||||
, Argument
|
||||
, ArgumentPack
|
||||
>::type _condition;
|
||||
|
||||
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
// Deduced parameter matches several arguments.
|
||||
BOOST_MPL_ASSERT((
|
||||
typename ::boost::mpl::eval_if<
|
||||
typename ::boost::parameter::aux::has_key_<
|
||||
UsedArgs
|
||||
, typename ::boost::parameter::aux::tag_type<_spec>::type
|
||||
>::type
|
||||
, ::boost::mpl::eval_if<
|
||||
_condition
|
||||
, ::boost::mpl::if_<
|
||||
EmitsErrors
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
>::type
|
||||
));
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
public:
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = typename ::boost::mp11::mp_if<
|
||||
#else
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
#endif
|
||||
_condition
|
||||
, ::boost::parameter::aux
|
||||
::tag_deduced<UsedArgs,_spec,Argument,TagFn>
|
||||
, ::boost::parameter::aux::deduce_tag<
|
||||
Argument
|
||||
, ArgumentPack
|
||||
, typename DeducedArgs::tail
|
||||
, UsedArgs
|
||||
, TagFn
|
||||
, EmitsErrors
|
||||
>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
>::type;
|
||||
#else
|
||||
>::type type;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/mpl/pair.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Tries to deduced a keyword tag for a given Argument.
|
||||
// Returns an mpl::pair<> consisting of the tagged_argument<>,
|
||||
// and an mpl::set<> where the new tag has been inserted.
|
||||
//
|
||||
// Argument: The argument type to be tagged.
|
||||
//
|
||||
// ArgumentPack: The ArgumentPack built so far.
|
||||
//
|
||||
// DeducedArgs: A specialization of deduced_item<> (see below).
|
||||
// A list containing only the deduced ParameterSpecs.
|
||||
//
|
||||
// UsedArgs: An mpl::set<> containing the keyword tags used so far.
|
||||
//
|
||||
// TagFn: A metafunction class used to tag positional or deduced
|
||||
// arguments with a keyword tag.
|
||||
template <
|
||||
typename Argument
|
||||
, typename ArgumentPack
|
||||
, typename DeducedArgs
|
||||
, typename UsedArgs
|
||||
, typename TagFn
|
||||
, typename EmitsErrors
|
||||
>
|
||||
struct deduce_tag
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
: ::boost::mp11::mp_if<
|
||||
::std::is_same<DeducedArgs,::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_identity<
|
||||
::boost::mp11::mp_list< ::boost::parameter::void_,UsedArgs>
|
||||
>
|
||||
#else
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::is_same<DeducedArgs,::boost::parameter::void_>
|
||||
, ::boost::mpl::pair< ::boost::parameter::void_,UsedArgs>
|
||||
#endif
|
||||
, ::boost::parameter::aux::deduce_tag0<
|
||||
Argument
|
||||
, ArgumentPack
|
||||
, DeducedArgs
|
||||
, UsedArgs
|
||||
, TagFn
|
||||
, EmitsErrors
|
||||
>
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
34
include/boost/parameter/aux_/pack/deduced_item.hpp
Normal file
34
include/boost/parameter/aux_/pack/deduced_item.hpp
Normal file
@@ -0,0 +1,34 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_DEDUCED_ITEM_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_DEDUCED_ITEM_HPP
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// A typelist that stored deduced parameter specs.
|
||||
template <
|
||||
typename ParameterSpec
|
||||
, typename Tail = ::boost::parameter::void_
|
||||
>
|
||||
struct deduced_item
|
||||
{
|
||||
typedef ParameterSpec spec;
|
||||
typedef Tail tail;
|
||||
};
|
||||
|
||||
// Evaluate Tail and construct deduced_item list.
|
||||
template <typename Spec, typename Tail>
|
||||
struct make_deduced_item
|
||||
{
|
||||
typedef ::boost::parameter::aux
|
||||
::deduced_item<Spec,typename Tail::type> type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
23
include/boost/parameter/aux_/pack/insert_tagged.hpp
Normal file
23
include/boost/parameter/aux_/pack/insert_tagged.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_INSERT_TAGGED_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_INSERT_TAGGED_HPP
|
||||
|
||||
#include <boost/parameter/aux_/set.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Inserts Tagged::key_type into the UserArgs set.
|
||||
// Extra indirection to lazily evaluate Tagged::key_type.
|
||||
template <typename UsedArgs, typename Tagged>
|
||||
struct insert_tagged
|
||||
: ::boost::parameter::aux::insert_<UsedArgs,typename Tagged::key_type>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
43
include/boost/parameter/aux_/pack/is_named_argument.hpp
Normal file
43
include/boost/parameter/aux_/pack/is_named_argument.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_IS_NAMED_ARGUMENT_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_IS_NAMED_ARGUMENT_HPP
|
||||
|
||||
#include <boost/parameter/aux_/template_keyword.hpp>
|
||||
#include <boost/parameter/aux_/is_tagged_argument.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using is_named_argument = ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::is_template_keyword<T>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::boost::parameter::aux::is_tagged_argument_mp11<T>
|
||||
>;
|
||||
#else
|
||||
struct is_named_argument
|
||||
: ::boost::mpl::if_<
|
||||
::boost::parameter::aux::is_template_keyword<T>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::parameter::aux::is_tagged_argument<T>
|
||||
>::type
|
||||
{
|
||||
};
|
||||
#endif
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
47
include/boost/parameter/aux_/pack/item.hpp
Normal file
47
include/boost/parameter/aux_/pack/item.hpp
Normal file
@@ -0,0 +1,47 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_ITEM_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_ITEM_HPP
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// A parameter spec item typelist.
|
||||
template <
|
||||
typename Spec
|
||||
, typename Arg
|
||||
, typename Tail = ::boost::parameter::void_
|
||||
>
|
||||
struct item
|
||||
{
|
||||
typedef Spec spec;
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
typedef ::boost::is_const<
|
||||
typename ::boost::remove_reference<Arg>::type
|
||||
> is_arg_const;
|
||||
#endif
|
||||
typedef Arg arg;
|
||||
typedef Tail tail;
|
||||
};
|
||||
|
||||
template <typename Spec, typename Arg, typename Tail>
|
||||
struct make_item
|
||||
{
|
||||
typedef boost::parameter::aux
|
||||
::item<Spec,Arg,typename Tail::type> type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
438
include/boost/parameter/aux_/pack/make_arg_list.hpp
Normal file
438
include/boost/parameter/aux_/pack/make_arg_list.hpp
Normal file
@@ -0,0 +1,438 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Copyright Cromwell D. Enage 2018.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_MAKE_ARG_LIST_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_MAKE_ARG_LIST_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <
|
||||
typename List
|
||||
, typename DeducedArgs
|
||||
, typename TagFn
|
||||
, typename IsPositional
|
||||
, typename UsedArgs
|
||||
, typename ArgumentPack
|
||||
, typename Error
|
||||
, typename EmitsErrors
|
||||
>
|
||||
struct make_arg_list_aux;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/arg_list.hpp>
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/parameter/aux_/pack/unmatched_argument.hpp>
|
||||
#include <boost/parameter/aux_/pack/tag_type.hpp>
|
||||
#include <boost/parameter/aux_/pack/is_named_argument.hpp>
|
||||
#include <boost/parameter/aux_/pack/insert_tagged.hpp>
|
||||
#include <boost/parameter/aux_/pack/deduce_tag.hpp>
|
||||
#include <boost/parameter/deduced.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/pair.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/apply_wrap.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename ArgumentPack, typename TaggedArg, typename EmitsErrors>
|
||||
struct append_to_make_arg_list
|
||||
{
|
||||
using type = ::boost::mp11::mp_push_front<
|
||||
ArgumentPack
|
||||
, ::boost::parameter::aux::flat_like_arg_tuple<
|
||||
typename TaggedArg::key_type
|
||||
, TaggedArg
|
||||
, EmitsErrors
|
||||
>
|
||||
>;
|
||||
};
|
||||
#endif
|
||||
|
||||
// Borland needs the insane extra-indirection workaround below so that
|
||||
// it doesn't magically drop the const qualifier from the argument type.
|
||||
template <
|
||||
typename List
|
||||
, typename DeducedArgs
|
||||
, typename TagFn
|
||||
, typename IsPositional
|
||||
, typename UsedArgs
|
||||
, typename ArgumentPack
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
, typename _argument
|
||||
#endif
|
||||
, typename Error
|
||||
, typename EmitsErrors
|
||||
>
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
class make_arg_list00
|
||||
#else
|
||||
class make_arg_list0
|
||||
#endif
|
||||
{
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
typedef typename List::arg _argument;
|
||||
#endif
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using _arg_type = typename ::std::remove_const<
|
||||
typename ::std::remove_reference<_argument>::type
|
||||
>::type;
|
||||
using _is_tagged = ::boost::parameter::aux
|
||||
::is_named_argument<_argument>;
|
||||
#else
|
||||
typedef typename ::boost::remove_const<
|
||||
typename ::boost::remove_reference<_argument>::type
|
||||
>::type _arg_type;
|
||||
typedef ::boost::parameter::aux
|
||||
::is_named_argument<_argument> _is_tagged;
|
||||
#endif
|
||||
typedef typename List::spec _parameter_spec;
|
||||
typedef typename ::boost::parameter::aux
|
||||
::tag_type<_parameter_spec>::type _tag;
|
||||
|
||||
// If this argument is either explicitly tagged or a deduced
|
||||
// parameter, then turn off positional matching.
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using _is_positional = ::boost::mp11::mp_if<
|
||||
IsPositional
|
||||
, ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::is_deduced<_parameter_spec>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_if<
|
||||
_is_tagged
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
>
|
||||
, ::boost::mp11::mp_false
|
||||
>;
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
IsPositional
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::parameter::aux::is_deduced<_parameter_spec>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::if_<
|
||||
_is_tagged
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
>
|
||||
, ::boost::mpl::false_
|
||||
>::type _is_positional;
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
// If this parameter is explicitly tagged, then add it to the
|
||||
// used-parmeters set. We only really need to add parameters
|
||||
// that are deduced, but we would need a way to check if
|
||||
// a given tag corresponds to a deduced parameter spec.
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using _used_args = typename ::boost::mp11::mp_if<
|
||||
_is_tagged
|
||||
, ::boost::parameter::aux::insert_tagged<UsedArgs,_arg_type>
|
||||
, ::boost::mp11::mp_identity<UsedArgs>
|
||||
>::type;
|
||||
#else
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
_is_tagged
|
||||
, ::boost::parameter::aux::insert_tagged<UsedArgs,_arg_type>
|
||||
, ::boost::mpl::identity<UsedArgs>
|
||||
>::type _used_args;
|
||||
#endif
|
||||
|
||||
// If this parameter is neither explicitly tagged nor positionally
|
||||
// matched, then deduce the tag from the deduced parameter specs.
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using _deduced_data = typename ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_if<
|
||||
_is_tagged
|
||||
, ::boost::mp11::mp_true
|
||||
, _is_positional
|
||||
>
|
||||
, ::boost::mp11::mp_identity<
|
||||
::boost::mp11::mp_list< ::boost::parameter::void_,_used_args>
|
||||
>
|
||||
#else
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
typename ::boost::mpl::if_<
|
||||
_is_tagged
|
||||
, ::boost::mpl::true_
|
||||
, _is_positional
|
||||
>::type
|
||||
, ::boost::mpl::pair< ::boost::parameter::void_,_used_args>
|
||||
#endif
|
||||
, ::boost::parameter::aux::deduce_tag<
|
||||
_argument
|
||||
, ArgumentPack
|
||||
, DeducedArgs
|
||||
, _used_args
|
||||
, TagFn
|
||||
, EmitsErrors
|
||||
>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
>::type;
|
||||
#else
|
||||
>::type _deduced_data;
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
// If this parameter is explicitly tagged ...
|
||||
using _tagged = ::boost::mp11::mp_if<
|
||||
_is_tagged
|
||||
// ... just use it
|
||||
, _arg_type
|
||||
// ... else ...
|
||||
, ::boost::mp11::mp_if<
|
||||
// if positional matching is turned on ...
|
||||
_is_positional
|
||||
// ... tag it positionally
|
||||
, ::boost::mp11::mp_apply_q<
|
||||
TagFn
|
||||
, ::boost::mp11::mp_list<_tag,_argument>
|
||||
>
|
||||
// ... else, use the deduced tag
|
||||
, ::boost::mp11::mp_at_c<_deduced_data,0>
|
||||
>
|
||||
>;
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
// If this parameter is explicitly tagged ...
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
_is_tagged
|
||||
// ... just use it
|
||||
, ::boost::mpl::identity<_arg_type>
|
||||
// ... else ...
|
||||
, ::boost::mpl::eval_if<
|
||||
// if positional matching is turned on ...
|
||||
_is_positional
|
||||
// ... tag it positionally
|
||||
, ::boost::mpl::apply_wrap2<TagFn,_tag,_argument>
|
||||
// ... else, use the deduced tag
|
||||
, ::boost::mpl::first<_deduced_data>
|
||||
>
|
||||
>::type _tagged;
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
// Build the arg_list incrementally, prepending new nodes.
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using _error = ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_same<Error,::boost::parameter::void_>
|
||||
, ::std::is_same<_tagged,::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_false
|
||||
>
|
||||
#else
|
||||
typedef typename ::boost::mpl::if_<
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::is_same<Error,::boost::parameter::void_>
|
||||
, ::boost::is_same<_tagged,::boost::parameter::void_>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
#endif
|
||||
, ::boost::parameter::aux::unmatched_argument<_argument>
|
||||
, ::boost::parameter::void_
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
>;
|
||||
#else
|
||||
>::type _error;
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using _argument_pack = typename ::boost::mp11::mp_if<
|
||||
::std::is_same<_tagged,::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_identity<ArgumentPack>
|
||||
, ::boost::parameter::aux
|
||||
::append_to_make_arg_list<ArgumentPack,_tagged,EmitsErrors>
|
||||
>::type;
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typedef typename ::boost::mpl::if_<
|
||||
::boost::is_same<_tagged,::boost::parameter::void_>
|
||||
, ArgumentPack
|
||||
#if defined(BOOST_NO_SFINAE) || BOOST_WORKAROUND(BOOST_MSVC, < 1800)
|
||||
, ::boost::parameter::aux::arg_list<_tagged,ArgumentPack>
|
||||
#else
|
||||
, ::boost::parameter::aux
|
||||
::arg_list<_tagged,ArgumentPack,EmitsErrors>
|
||||
#endif
|
||||
>::type _argument_pack;
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
public:
|
||||
typedef typename ::boost::parameter::aux::make_arg_list_aux<
|
||||
typename List::tail
|
||||
, DeducedArgs
|
||||
, TagFn
|
||||
, _is_positional
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
, ::boost::mp11::mp_at_c<_deduced_data,1>
|
||||
#else
|
||||
, typename _deduced_data::second
|
||||
#endif
|
||||
, _argument_pack
|
||||
, _error
|
||||
, EmitsErrors
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
template <
|
||||
typename List
|
||||
, typename DeducedArgs
|
||||
, typename TagFn
|
||||
, typename IsPositional
|
||||
, typename UsedArgs
|
||||
, typename ArgumentPack
|
||||
, typename Error
|
||||
, typename EmitsErrors
|
||||
>
|
||||
struct make_arg_list0
|
||||
{
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
typename List::is_arg_const
|
||||
, ::boost::parameter::aux::make_arg_list00<
|
||||
List
|
||||
, DeducedArgs
|
||||
, TagFn
|
||||
, IsPositional
|
||||
, UsedArgs
|
||||
, ArgumentPack
|
||||
, typename List::arg const
|
||||
, Error
|
||||
, EmitsErrors
|
||||
>
|
||||
, ::boost::parameter::aux::make_arg_list00<
|
||||
List
|
||||
, DeducedArgs
|
||||
, TagFn
|
||||
, IsPositional
|
||||
, UsedArgs
|
||||
, ArgumentPack
|
||||
, typename List::arg
|
||||
, Error
|
||||
, EmitsErrors
|
||||
>
|
||||
>::type type;
|
||||
};
|
||||
#endif // Borland workarounds needed.
|
||||
|
||||
// Returns an ArgumentPack where the list of arguments has been tagged
|
||||
// with keyword tags.
|
||||
//
|
||||
// List: A specialization of item<> (see below). Contains both
|
||||
// the ordered ParameterSpecs, and the given arguments.
|
||||
//
|
||||
// DeducedArgs: A specialization of deduced_item<> (see below).
|
||||
// A list containing only the deduced ParameterSpecs.
|
||||
//
|
||||
// TagFn: A metafunction class used to tag positional or deduced
|
||||
// arguments with a keyword tag.
|
||||
//
|
||||
// IsPositional: An mpl::bool_<> specialization indicating if positional
|
||||
// matching is to be performed.
|
||||
//
|
||||
// DeducedSet: An mpl::set<> containing the keyword tags used so far.
|
||||
//
|
||||
// ArgumentPack: The ArgumentPack built so far. This is initially an
|
||||
// empty_arg_list and is built incrementally.
|
||||
template <
|
||||
typename List
|
||||
, typename DeducedArgs
|
||||
, typename TagFn
|
||||
, typename IsPositional
|
||||
, typename DeducedSet
|
||||
, typename ArgumentPack
|
||||
, typename Error
|
||||
, typename EmitsErrors
|
||||
>
|
||||
struct make_arg_list_aux
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
: ::boost::mp11::mp_if<
|
||||
::std::is_same<List,::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_identity<
|
||||
::boost::mp11::mp_list<ArgumentPack,Error>
|
||||
>
|
||||
#else
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::is_same<List,::boost::parameter::void_>
|
||||
, ::boost::mpl::identity< ::boost::mpl::pair<ArgumentPack,Error> >
|
||||
#endif
|
||||
, ::boost::parameter::aux::make_arg_list0<
|
||||
List
|
||||
, DeducedArgs
|
||||
, TagFn
|
||||
, IsPositional
|
||||
, DeducedSet
|
||||
, ArgumentPack
|
||||
, Error
|
||||
, EmitsErrors
|
||||
>
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/set.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// VC6.5 was choking on the default parameters for make_arg_list_aux,
|
||||
// so this just forwards to that adding in the defaults.
|
||||
template <
|
||||
typename List
|
||||
, typename DeducedArgs
|
||||
, typename TagFn
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
, typename EmitsErrors = ::boost::mp11::mp_true
|
||||
#else
|
||||
, typename EmitsErrors = ::boost::mpl::true_
|
||||
#endif
|
||||
>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using make_arg_list = ::boost::parameter::aux::make_arg_list_aux<
|
||||
#else
|
||||
struct make_arg_list
|
||||
: ::boost::parameter::aux::make_arg_list_aux<
|
||||
#endif
|
||||
List
|
||||
, DeducedArgs
|
||||
, TagFn
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
, ::boost::mp11::mp_true
|
||||
#else
|
||||
, ::boost::mpl::true_
|
||||
#endif
|
||||
, ::boost::parameter::aux::set0
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
, ::boost::parameter::aux::flat_like_arg_list<>
|
||||
#else
|
||||
, ::boost::parameter::aux::empty_arg_list
|
||||
#endif
|
||||
, ::boost::parameter::void_
|
||||
, EmitsErrors
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
>;
|
||||
#else
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
53
include/boost/parameter/aux_/pack/make_deduced_items.hpp
Normal file
53
include/boost/parameter/aux_/pack/make_deduced_items.hpp
Normal file
@@ -0,0 +1,53 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_MAKE_DEDUCED_ITEMS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_MAKE_DEDUCED_ITEMS_HPP
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/parameter/aux_/pack/deduced_item.hpp>
|
||||
#include <boost/parameter/deduced.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Spec, typename Tail>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using make_deduced_items = ::boost::mp11::mp_if<
|
||||
::std::is_same<Spec,::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::is_deduced<Spec>
|
||||
, ::boost::parameter::aux::make_deduced_item<Spec,Tail>
|
||||
, Tail
|
||||
>
|
||||
>;
|
||||
#else
|
||||
struct make_deduced_items
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::is_same<Spec,::boost::parameter::void_>
|
||||
, ::boost::mpl::identity< ::boost::parameter::void_>
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::parameter::aux::is_deduced<Spec>
|
||||
, ::boost::parameter::aux::make_deduced_item<Spec,Tail>
|
||||
, Tail
|
||||
>
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
45
include/boost/parameter/aux_/pack/make_items.hpp
Normal file
45
include/boost/parameter/aux_/pack/make_items.hpp
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_MAKE_ITEMS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_MAKE_ITEMS_HPP
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/parameter/aux_/pack/item.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Creates a item typelist.
|
||||
template <typename Spec, typename Arg, typename Tail>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using make_items = ::boost::mp11::mp_if<
|
||||
::std::is_same<Arg,::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
|
||||
, ::boost::parameter::aux::make_item<Spec,Arg,Tail>
|
||||
>;
|
||||
#else
|
||||
struct make_items
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::is_same<Arg,::boost::parameter::void_>
|
||||
, ::boost::mpl::identity< ::boost::parameter::void_>
|
||||
, ::boost::parameter::aux::make_item<Spec,Arg,Tail>
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
244
include/boost/parameter/aux_/pack/make_parameter_spec_items.hpp
Normal file
244
include/boost/parameter/aux_/pack/make_parameter_spec_items.hpp
Normal file
@@ -0,0 +1,244 @@
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_MAKE_PARAMETER_SPEC_ITEMS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_MAKE_PARAMETER_SPEC_ITEMS_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// This recursive metafunction forwards successive elements of
|
||||
// parameters::parameter_spec to make_deduced_items<>.
|
||||
// -- Cromwell D. Enage
|
||||
template <typename SpecSeq>
|
||||
struct make_deduced_list;
|
||||
|
||||
// Helper for match_parameters_base_cond<...>, below.
|
||||
template <typename ArgumentPackAndError, typename SpecSeq>
|
||||
struct match_parameters_base_cond_helper;
|
||||
|
||||
// Helper metafunction for make_parameter_spec_items<...>, below.
|
||||
template <typename SpecSeq, typename ...Args>
|
||||
struct make_parameter_spec_items_helper;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename SpecSeq>
|
||||
struct make_parameter_spec_items_helper<SpecSeq>
|
||||
{
|
||||
typedef ::boost::parameter::void_ type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/pack/make_deduced_items.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/list.hpp>
|
||||
#else
|
||||
#include <boost/mpl/front.hpp>
|
||||
#include <boost/mpl/pop_front.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename SpecSeq>
|
||||
struct make_deduced_list_not_empty
|
||||
: ::boost::parameter::aux::make_deduced_items<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_front<SpecSeq>
|
||||
#else
|
||||
typename ::boost::mpl::front<SpecSeq>::type
|
||||
#endif
|
||||
, ::boost::parameter::aux::make_deduced_list<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_pop_front<SpecSeq>
|
||||
#else
|
||||
typename ::boost::mpl::pop_front<SpecSeq>::type
|
||||
#endif
|
||||
>
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#else
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/empty.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename SpecSeq>
|
||||
struct make_deduced_list
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
: ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_empty<SpecSeq>
|
||||
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
|
||||
#else
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::mpl::empty<SpecSeq>
|
||||
, ::boost::mpl::identity< ::boost::parameter::void_>
|
||||
#endif
|
||||
, ::boost::parameter::aux::make_deduced_list_not_empty<SpecSeq>
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/pair.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename ArgumentPackAndError>
|
||||
struct is_arg_pack_error_void
|
||||
: ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename ::boost::mpl::second<ArgumentPackAndError>::type
|
||||
, ::boost::parameter::void_
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Checks if the arguments match the criteria of overload resolution.
|
||||
// If NamedList satisfies the PS0, PS1, ..., this is a metafunction
|
||||
// returning parameters. Otherwise it has no nested ::type.
|
||||
template <typename ArgumentPackAndError, typename SpecSeq>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using match_parameters_base_cond = ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_empty<SpecSeq>
|
||||
, ::std::is_same<
|
||||
::boost::mp11::mp_at_c<ArgumentPackAndError,1>
|
||||
, ::boost::parameter::void_
|
||||
>
|
||||
, ::boost::parameter::aux::match_parameters_base_cond_helper<
|
||||
ArgumentPackAndError
|
||||
, SpecSeq
|
||||
>
|
||||
>;
|
||||
#else
|
||||
struct match_parameters_base_cond
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::mpl::empty<SpecSeq>
|
||||
, ::boost::parameter::aux
|
||||
::is_arg_pack_error_void<ArgumentPackAndError>
|
||||
, ::boost::parameter::aux::match_parameters_base_cond_helper<
|
||||
ArgumentPackAndError
|
||||
, SpecSeq
|
||||
>
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/pack/satisfies.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename ArgumentPackAndError, typename SpecSeq>
|
||||
struct match_parameters_base_cond_helper
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
: ::boost::mp11::mp_if<
|
||||
#else
|
||||
: ::boost::mpl::eval_if<
|
||||
#endif
|
||||
::boost::parameter::aux::satisfies_requirements_of<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_at_c<ArgumentPackAndError,0>
|
||||
, ::boost::mp11::mp_front<SpecSeq>
|
||||
#else
|
||||
typename ::boost::mpl::first<ArgumentPackAndError>::type
|
||||
, typename ::boost::mpl::front<SpecSeq>::type
|
||||
#endif
|
||||
>
|
||||
, ::boost::parameter::aux::match_parameters_base_cond<
|
||||
ArgumentPackAndError
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
, ::boost::mp11::mp_pop_front<SpecSeq>
|
||||
#else
|
||||
, typename ::boost::mpl::pop_front<SpecSeq>::type
|
||||
#endif
|
||||
>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
, ::boost::mp11::mp_false
|
||||
#else
|
||||
, ::boost::mpl::false_
|
||||
#endif
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
// This parameters item chaining metafunction class does not require
|
||||
// the lengths of the SpecSeq and of Args parameter pack to match.
|
||||
// Used by argument_pack to build the items in the resulting arg_list.
|
||||
// -- Cromwell D. Enage
|
||||
template <typename SpecSeq, typename ...Args>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using make_parameter_spec_items = ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_empty<SpecSeq>
|
||||
, ::boost::mp11::mp_identity< ::boost::parameter::void_>
|
||||
, ::boost::parameter::aux
|
||||
::make_parameter_spec_items_helper<SpecSeq,Args...>
|
||||
>;
|
||||
#else
|
||||
struct make_parameter_spec_items
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::mpl::empty<SpecSeq>
|
||||
, ::boost::mpl::identity< ::boost::parameter::void_>
|
||||
, ::boost::parameter::aux
|
||||
::make_parameter_spec_items_helper<SpecSeq,Args...>
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/pack/make_items.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename SpecSeq, typename A0, typename ...Args>
|
||||
struct make_parameter_spec_items_helper<SpecSeq,A0,Args...>
|
||||
: ::boost::parameter::aux::make_items<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_front<SpecSeq>
|
||||
#else
|
||||
typename ::boost::mpl::front<SpecSeq>::type
|
||||
#endif
|
||||
, A0
|
||||
, ::boost::parameter::aux::make_parameter_spec_items<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_pop_front<SpecSeq>
|
||||
#else
|
||||
typename ::boost::mpl::pop_front<SpecSeq>::type
|
||||
#endif
|
||||
, Args...
|
||||
>
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
25
include/boost/parameter/aux_/pack/parameter_requirements.hpp
Normal file
25
include/boost/parameter/aux_/pack/parameter_requirements.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_PARAMETER_REQUIREMENTS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_PARAMETER_REQUIREMENTS_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Used to pass static information about parameter requirements through
|
||||
// the satisfies() overload set (below). The matched function is never
|
||||
// invoked, but its type indicates whether a parameter matches at
|
||||
// compile-time.
|
||||
template <typename Keyword, typename Predicate, typename HasDefault>
|
||||
struct parameter_requirements
|
||||
{
|
||||
typedef Keyword keyword;
|
||||
typedef Predicate predicate;
|
||||
typedef HasDefault has_default;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
87
include/boost/parameter/aux_/pack/predicate.hpp
Normal file
87
include/boost/parameter/aux_/pack/predicate.hpp
Normal file
@@ -0,0 +1,87 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_PREDICATE_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_PREDICATE_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// helper for get_predicate<...>, below
|
||||
template <typename T>
|
||||
struct get_predicate_or_default
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
// helper for predicate<...>, below
|
||||
template <typename T>
|
||||
struct get_predicate
|
||||
: ::boost::parameter::aux
|
||||
::get_predicate_or_default<typename T::predicate>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/use_default.hpp>
|
||||
#include <boost/parameter/aux_/always_true_predicate.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <>
|
||||
struct get_predicate_or_default< ::boost::parameter::aux::use_default>
|
||||
{
|
||||
typedef ::boost::parameter::aux::always_true_predicate type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/required.hpp>
|
||||
#include <boost/parameter/optional.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using predicate = ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::is_optional<T>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::boost::parameter::aux::is_required<T>
|
||||
>
|
||||
, ::boost::parameter::aux::get_predicate<T>
|
||||
, ::boost::mp11::mp_identity<
|
||||
::boost::parameter::aux::always_true_predicate
|
||||
>
|
||||
>;
|
||||
#else
|
||||
struct predicate
|
||||
: ::boost::mpl::eval_if<
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::parameter::aux::is_optional<T>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::parameter::aux::is_required<T>
|
||||
>::type
|
||||
, ::boost::parameter::aux::get_predicate<T>
|
||||
, ::boost::mpl::identity<
|
||||
::boost::parameter::aux::always_true_predicate
|
||||
>
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
142
include/boost/parameter/aux_/pack/satisfies.hpp
Normal file
142
include/boost/parameter/aux_/pack/satisfies.hpp
Normal file
@@ -0,0 +1,142 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_SATISFIES_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_SATISFIES_HPP
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
#include <boost/parameter/aux_/arg_list.hpp>
|
||||
#include <boost/parameter/aux_/augment_predicate.hpp>
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/apply_wrap.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#else // !BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#endif
|
||||
#include <boost/parameter/aux_/yesno.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
|
||||
#endif // MSVC-7.1 workarounds needed
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
template <typename ArgList, typename ParameterRequirements, typename Bound>
|
||||
struct satisfies_impl
|
||||
: ::boost::parameter::aux::augment_predicate<
|
||||
typename ParameterRequirements::predicate
|
||||
, typename ArgList::reference
|
||||
, typename ArgList::key_type
|
||||
, Bound
|
||||
, ArgList
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
// Returns mpl::true_ iff the given ParameterRequirements are satisfied by
|
||||
// ArgList.
|
||||
template <typename ArgList, typename ParameterRequirements>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using satisfies = ::boost::mp11::mp_bool<
|
||||
sizeof(
|
||||
::boost::parameter::aux::to_yesno(
|
||||
ArgList::satisfies(
|
||||
static_cast<ParameterRequirements*>(
|
||||
BOOST_PARAMETER_AUX_PP_NULLPTR
|
||||
)
|
||||
, static_cast<ArgList*>(BOOST_PARAMETER_AUX_PP_NULLPTR)
|
||||
)
|
||||
)
|
||||
) == sizeof(::boost::parameter::aux::yes_tag)
|
||||
>;
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
class satisfies
|
||||
{
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
// VC7.1 can't handle the sizeof() implementation below,
|
||||
// so we use this instead.
|
||||
typedef typename ::boost::mpl::apply_wrap3<
|
||||
typename ArgList::binding
|
||||
, typename ParameterRequirements::keyword
|
||||
, ::boost::parameter::void_
|
||||
, ::boost::mpl::false_
|
||||
>::type _bound;
|
||||
|
||||
public:
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
::boost::is_same<_bound,::boost::parameter::void_>
|
||||
, typename ParameterRequirements::has_default
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
ArgList
|
||||
, ::boost::parameter::aux::empty_arg_list
|
||||
>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::parameter::aux::satisfies_impl<
|
||||
ArgList
|
||||
, ParameterRequirements
|
||||
, _bound
|
||||
>
|
||||
>
|
||||
>::type type;
|
||||
#else // !BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, _value = (
|
||||
sizeof(
|
||||
::boost::parameter::aux::to_yesno(
|
||||
ArgList::satisfies(
|
||||
static_cast<ParameterRequirements*>(
|
||||
BOOST_PARAMETER_AUX_PP_NULLPTR
|
||||
)
|
||||
, static_cast<ArgList*>(BOOST_PARAMETER_AUX_PP_NULLPTR)
|
||||
)
|
||||
)
|
||||
) == sizeof(::boost::parameter::aux::yes_tag)
|
||||
)
|
||||
);
|
||||
|
||||
public:
|
||||
typedef ::boost::mpl::bool_<
|
||||
::boost::parameter::aux
|
||||
::satisfies<ArgList,ParameterRequirements>::_value
|
||||
> type;
|
||||
#endif // MSVC-7.1 workarounds needed
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/pack/as_parameter_requirements.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Returns mpl::true_ if the requirements of the given ParameterSpec
|
||||
// are satisfied by ArgList.
|
||||
template <typename ArgList, typename ParameterSpec>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using satisfies_requirements_of = ::boost::parameter::aux::satisfies<
|
||||
ArgList
|
||||
, typename ::boost::parameter::aux
|
||||
::as_parameter_requirements<ParameterSpec>::type
|
||||
>;
|
||||
#else
|
||||
struct satisfies_requirements_of
|
||||
: ::boost::parameter::aux::satisfies<
|
||||
ArgList
|
||||
, typename ::boost::parameter::aux
|
||||
::as_parameter_requirements<ParameterSpec>::type
|
||||
>::type
|
||||
{
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
59
include/boost/parameter/aux_/pack/tag_deduced.hpp
Normal file
59
include/boost/parameter/aux_/pack/tag_deduced.hpp
Normal file
@@ -0,0 +1,59 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_TAG_DEDUCED_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_TAG_DEDUCED_HPP
|
||||
|
||||
#include <boost/parameter/aux_/set.hpp>
|
||||
#include <boost/parameter/aux_/pack/tag_type.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#else
|
||||
#include <boost/mpl/pair.hpp>
|
||||
#include <boost/mpl/apply_wrap.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Tags a deduced argument Arg with the keyword tag of Spec using TagFn.
|
||||
// Returns the tagged argument and the mpl::set<> UsedArgs with the
|
||||
// tag of Spec inserted.
|
||||
template <typename UsedArgs, typename Spec, typename Arg, typename TagFn>
|
||||
struct tag_deduced
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = ::boost::mp11::mp_list<
|
||||
::boost::mp11::mp_apply_q<
|
||||
TagFn
|
||||
, ::boost::mp11::mp_list<
|
||||
typename ::boost::parameter::aux::tag_type<Spec>::type
|
||||
, Arg
|
||||
>
|
||||
>
|
||||
#else
|
||||
typedef ::boost::mpl::pair<
|
||||
typename ::boost::mpl::apply_wrap2<
|
||||
TagFn
|
||||
, typename ::boost::parameter::aux::tag_type<Spec>::type
|
||||
, Arg
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, typename ::boost::parameter::aux::insert_<
|
||||
UsedArgs
|
||||
, typename ::boost::parameter::aux::tag_type<Spec>::type
|
||||
>::type
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
>;
|
||||
#else
|
||||
> type;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
30
include/boost/parameter/aux_/pack/tag_keyword_arg.hpp
Normal file
30
include/boost/parameter/aux_/pack/tag_keyword_arg.hpp
Normal file
@@ -0,0 +1,30 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_HPP
|
||||
|
||||
#include <boost/parameter/aux_/tag.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
struct tag_keyword_arg
|
||||
{
|
||||
template <typename K, typename T>
|
||||
struct apply
|
||||
{
|
||||
typedef typename ::boost::parameter::aux::tag<K,T>::type type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename K, typename T>
|
||||
using fn = typename ::boost::parameter::aux::tag<K,T>::type;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
67
include/boost/parameter/aux_/pack/tag_keyword_arg_ref.hpp
Normal file
67
include/boost/parameter/aux_/pack/tag_keyword_arg_ref.hpp
Normal file
@@ -0,0 +1,67 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_REF_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_TAG_KEYWORD_ARG_REF_HPP
|
||||
|
||||
#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
|
||||
#include <boost/parameter/aux_/tagged_argument.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <
|
||||
typename Keyword
|
||||
, typename ActualArg
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
, typename = typename ::boost::parameter::aux
|
||||
::is_cv_reference_wrapper<ActualArg>::type
|
||||
#endif
|
||||
>
|
||||
struct tag_ref
|
||||
{
|
||||
typedef ::boost::parameter::aux::tagged_argument<
|
||||
Keyword
|
||||
, typename ::boost::parameter::aux
|
||||
::unwrap_cv_reference<ActualArg>::type
|
||||
> type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux_
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Keyword, typename ActualArg>
|
||||
struct tag_ref<Keyword,ActualArg,::boost::mpl::false_>
|
||||
{
|
||||
typedef ::boost::parameter::aux
|
||||
::tagged_argument<Keyword,ActualArg> type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux_
|
||||
|
||||
#endif // Borland workarounds needed.
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
struct tag_keyword_arg_ref
|
||||
{
|
||||
template <typename K, typename T>
|
||||
struct apply
|
||||
{
|
||||
typedef typename ::boost::parameter::aux::tag_ref<K,T>::type type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename K, typename T>
|
||||
using fn = typename ::boost::parameter::aux::tag_ref<K,T>::type;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_TAG_TEMPLATE_KEYWORD_ARG_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_TAG_TEMPLATE_KEYWORD_ARG_HPP
|
||||
|
||||
#include <boost/parameter/template_keyword.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
struct tag_template_keyword_arg
|
||||
{
|
||||
template <typename K, typename T>
|
||||
struct apply
|
||||
{
|
||||
typedef ::boost::parameter::template_keyword<K,T> type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename K, typename T>
|
||||
using fn = ::boost::parameter::template_keyword<K,T>;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
89
include/boost/parameter/aux_/pack/tag_type.hpp
Normal file
89
include/boost/parameter/aux_/pack/tag_type.hpp
Normal file
@@ -0,0 +1,89 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_TAG_TYPE_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_TAG_TYPE_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// helper for tag_type<...>, below.
|
||||
template <typename T>
|
||||
struct get_tag_type0
|
||||
{
|
||||
typedef typename T::key_type type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/deduced.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#else
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct get_tag_type
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
: ::boost::mp11::mp_if<
|
||||
#else
|
||||
: ::boost::mpl::eval_if<
|
||||
#endif
|
||||
::boost::parameter::aux::is_deduced0<T>
|
||||
, ::boost::parameter::aux::get_tag_type0<typename T::key_type>
|
||||
, ::boost::parameter::aux::get_tag_type0<T>
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/required.hpp>
|
||||
#include <boost/parameter/optional.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
using tag_type = ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::is_optional<T>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::boost::parameter::aux::is_required<T>
|
||||
>
|
||||
, ::boost::parameter::aux::get_tag_type<T>
|
||||
, ::boost::mp11::mp_identity<T>
|
||||
>;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct tag_type
|
||||
: ::boost::mpl::eval_if<
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::parameter::aux::is_optional<T>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::parameter::aux::is_required<T>
|
||||
>::type
|
||||
, ::boost::parameter::aux::get_tag_type<T>
|
||||
, ::boost::mpl::identity<T>
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
#endif // include guard
|
||||
|
||||
41
include/boost/parameter/aux_/pack/unmatched_argument.hpp
Normal file
41
include/boost/parameter/aux_/pack/unmatched_argument.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PACK_UNMATCHED_ARGUMENT_HPP
|
||||
#define BOOST_PARAMETER_AUX_PACK_UNMATCHED_ARGUMENT_HPP
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct unmatched_argument
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
static_assert(::std::is_same<T,void>::value, "T == void");
|
||||
#else
|
||||
BOOST_MPL_ASSERT((
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::is_same<T,void>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
));
|
||||
#endif
|
||||
typedef int type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
27
include/boost/parameter/aux_/parameter_requirements.hpp
Executable file → Normal file
27
include/boost/parameter/aux_/parameter_requirements.hpp
Executable file → Normal file
@@ -1,25 +1,12 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef PARAMETER_REQUIREMENTS_050331_HPP
|
||||
#define PARAMETER_REQUIREMENTS_050331_HPP
|
||||
#ifndef BOOST_PARAMETER_AUX_PARAMETER_REQUIREMENTS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PARAMETER_REQUIREMENTS_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
#include <boost/parameter/aux_/pack/parameter_requirements.hpp>
|
||||
|
||||
// Used to pass static information about parameter requirements
|
||||
// through the satisfies() overload set (below). The
|
||||
// matched function is never invoked, but its type indicates whether
|
||||
// a parameter matches at compile-time
|
||||
template <class Keyword, class Predicate, class HasDefault>
|
||||
struct parameter_requirements
|
||||
{
|
||||
typedef Keyword keyword;
|
||||
typedef Predicate predicate;
|
||||
typedef HasDefault has_default;
|
||||
};
|
||||
#endif // include guard
|
||||
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // PARAMETER_REQUIREMENTS_050331_HPP
|
||||
|
||||
12
include/boost/parameter/aux_/parenthesized_type.hpp
Normal file
12
include/boost/parameter/aux_/parenthesized_type.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright David Abrahams 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
|
||||
#define BOOST_PARAMETER_AUX_PARENTHESIZED_TYPE_DWA2006414_HPP
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
|
||||
|
||||
#endif // include guard
|
||||
|
||||
91
include/boost/parameter/aux_/pp_impl/argument_pack.hpp
Normal file
91
include/boost/parameter/aux_/pp_impl/argument_pack.hpp
Normal file
@@ -0,0 +1,91 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PP_IMPL_ARGUMENT_PACK_HPP
|
||||
#define BOOST_PARAMETER_AUX_PP_IMPL_ARGUMENT_PACK_HPP
|
||||
|
||||
#include <boost/parameter/aux_/pack/tag_keyword_arg.hpp>
|
||||
#include <boost/parameter/aux_/pack/make_arg_list.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#include <boost/parameter/aux_/pack/make_parameter_spec_items.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/list.hpp>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/pair.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Parameters, typename ...Args>
|
||||
struct argument_pack
|
||||
{
|
||||
typedef typename ::boost::parameter::aux::make_arg_list<
|
||||
typename ::boost::parameter::aux::make_parameter_spec_items<
|
||||
typename Parameters::parameter_spec
|
||||
, Args...
|
||||
>::type
|
||||
, typename Parameters::deduced_list
|
||||
, ::boost::parameter::aux::tag_keyword_arg
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
, ::boost::mp11::mp_false
|
||||
#else
|
||||
, ::boost::mpl::false_
|
||||
#endif
|
||||
>::type result;
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = ::boost::mp11::mp_at_c<result,0>;
|
||||
#else
|
||||
typedef typename ::boost::mpl::first<result>::type type;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/parameter/aux_/pack/make_items.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/no_perfect_forwarding_begin.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/pair.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <
|
||||
typename Parameters
|
||||
BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
|
||||
BOOST_PARAMETER_MAX_ARITY
|
||||
, typename A
|
||||
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT
|
||||
)
|
||||
>
|
||||
struct argument_pack
|
||||
{
|
||||
typedef typename ::boost::parameter::aux::make_arg_list<
|
||||
typename BOOST_PARAMETER_build_arg_list(
|
||||
BOOST_PARAMETER_MAX_ARITY
|
||||
, ::boost::parameter::aux::make_items
|
||||
, typename Parameters::parameter_spec
|
||||
, A
|
||||
)::type
|
||||
, typename Parameters::deduced_list
|
||||
, ::boost::parameter::aux::tag_keyword_arg
|
||||
, ::boost::mpl::false_
|
||||
>::type result;
|
||||
typedef typename ::boost::mpl::first<result>::type type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/no_perfect_forwarding_end.hpp>
|
||||
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
#endif // include guard
|
||||
|
||||
55
include/boost/parameter/aux_/pp_impl/match.hpp
Normal file
55
include/boost/parameter/aux_/pp_impl/match.hpp
Normal file
@@ -0,0 +1,55 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PP_IMPL_MATCH_HPP
|
||||
#define BOOST_PARAMETER_AUX_PP_IMPL_MATCH_HPP
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Recast the ParameterSpec's nested match metafunction
|
||||
// as a free metafunction.
|
||||
//
|
||||
// No more limits set by BOOST_PARAMETER_MAX_ARITY. -- Cromwell D. Enage
|
||||
template <typename Parameters, typename ...Args>
|
||||
struct match : Parameters::BOOST_NESTED_TEMPLATE match<Args...>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Recast the ParameterSpec's nested match metafunction
|
||||
// as a free metafunction.
|
||||
template <
|
||||
typename Parameters
|
||||
BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
|
||||
BOOST_PARAMETER_MAX_ARITY
|
||||
, typename A
|
||||
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT
|
||||
)
|
||||
>
|
||||
struct match
|
||||
: Parameters::BOOST_NESTED_TEMPLATE match<
|
||||
BOOST_PP_ENUM_PARAMS(BOOST_PARAMETER_MAX_ARITY, A)
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
#endif // include guard
|
||||
|
||||
97
include/boost/parameter/aux_/pp_impl/unwrap_predicate.hpp
Normal file
97
include/boost/parameter/aux_/pp_impl/unwrap_predicate.hpp
Normal file
@@ -0,0 +1,97 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PP_IMPL_UNWRAP_PREDICATE_HPP
|
||||
#define BOOST_PARAMETER_AUX_PP_IMPL_UNWRAP_PREDICATE_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Given Match, which is "void x" where x is an argument matching
|
||||
// criterion, extract a corresponding MPL predicate.
|
||||
template <typename Match>
|
||||
struct unwrap_predicate;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/always_true_predicate.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Match anything
|
||||
template <>
|
||||
struct unwrap_predicate<void*>
|
||||
{
|
||||
typedef ::boost::parameter::aux::always_true_predicate type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// A matching predicate is explicitly specified.
|
||||
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
|
||||
template <typename Predicate>
|
||||
struct unwrap_predicate< ::boost::parameter::aux::voidstar(Predicate)>
|
||||
{
|
||||
typedef Predicate type;
|
||||
};
|
||||
#else
|
||||
template <typename Predicate>
|
||||
struct unwrap_predicate<void *(Predicate)>
|
||||
{
|
||||
typedef Predicate type;
|
||||
};
|
||||
#endif // SunProCC workarounds needed.
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// A type to which the argument is supposed to be convertible is
|
||||
// specified.
|
||||
template <typename Target>
|
||||
struct unwrap_predicate<void (Target)>
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
struct type
|
||||
{
|
||||
template <typename Argument, typename ArgumentPack>
|
||||
struct apply
|
||||
: ::boost::mpl::if_<
|
||||
::std::is_convertible<Argument,Target>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename Argument, typename ArgumentPack>
|
||||
using fn = ::std::is_convertible<Argument,Target>;
|
||||
};
|
||||
#else
|
||||
typedef ::boost::mpl::if_<
|
||||
::boost::is_convertible< ::boost::mpl::_,Target>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
> type;
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
1638
include/boost/parameter/aux_/preprocessor/binary_seq_for_each.hpp
Normal file
1638
include/boost/parameter/aux_/preprocessor/binary_seq_for_each.hpp
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_BINARY_SEQ_TO_ARGS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_BINARY_SEQ_TO_ARGS_HPP
|
||||
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_1(n, prefix_seq) \
|
||||
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, prefix_seq), n) const&
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_1(n, prefix_seq) \
|
||||
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, prefix_seq), n)&
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_2(n, prefix_seq) \
|
||||
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_1(n, prefix_seq) \
|
||||
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, prefix_seq), n)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_2(n, prefix_seq) \
|
||||
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_1(n, prefix_seq) \
|
||||
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, prefix_seq), n)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/seq/size.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0(prefix_seq) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0_ \
|
||||
, BOOST_PP_SEQ_SIZE(prefix_seq) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1(prefix_seq) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1_ \
|
||||
, BOOST_PP_SEQ_SIZE(prefix_seq) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/convert_binary_seq.hpp>
|
||||
|
||||
// This macro converts the specified Boost.Preprocessor sequence of 1s and 0s
|
||||
// into a formal function parameter list.
|
||||
//
|
||||
// Example:
|
||||
// BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS((1)(0)(1)(0), (P)(p))
|
||||
// expands to
|
||||
// P0 & p0, P1 const& p1, P2 & p2, P3 const& p3
|
||||
#define BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS(binary_seq, prefix_seq) \
|
||||
BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ( \
|
||||
binary_seq \
|
||||
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_0(prefix_seq) \
|
||||
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARG_1(prefix_seq) \
|
||||
, prefix_seq \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
// Copyright Cromwell D. Enage 2013.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_CONVERT_BINARY_SEQ_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_CONVERT_BINARY_SEQ_HPP
|
||||
|
||||
#include <boost/preprocessor/seq/size.hpp>
|
||||
#include <boost/preprocessor/seq/push_back.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_AUGMENT_BINARY_SEQ_INDEX_FOLD_OP(s, seq, idx) \
|
||||
BOOST_PP_SEQ_PUSH_BACK(seq, (idx, BOOST_PP_SEQ_SIZE(seq)))
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/control/iif.hpp>
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ_FOLD_OP(s, seq, elem) \
|
||||
( \
|
||||
BOOST_PP_SEQ_PUSH_BACK( \
|
||||
BOOST_PP_SEQ_ELEM(0, seq) \
|
||||
, BOOST_PP_IIF( \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, elem) \
|
||||
, BOOST_PP_SEQ_ELEM(2, seq) \
|
||||
, BOOST_PP_SEQ_ELEM(1, seq) \
|
||||
)(BOOST_PP_TUPLE_ELEM(2, 1, elem), BOOST_PP_SEQ_ELEM(3, seq)) \
|
||||
) \
|
||||
)(BOOST_PP_SEQ_ELEM(1, seq))(BOOST_PP_SEQ_ELEM(2, seq)) \
|
||||
(BOOST_PP_SEQ_ELEM(3, seq))
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/seq_enum.hpp>
|
||||
#include <boost/preprocessor/facilities/empty.hpp>
|
||||
#include <boost/preprocessor/seq/seq.hpp>
|
||||
#include <boost/preprocessor/seq/fold_left.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ(seq, macro0, macro1, data) \
|
||||
BOOST_PARAMETER_SEQ_ENUM( \
|
||||
BOOST_PP_SEQ_ELEM( \
|
||||
0 \
|
||||
, BOOST_PP_SEQ_FOLD_LEFT( \
|
||||
BOOST_PARAMETER_AUX_PP_CONVERT_BINARY_SEQ_FOLD_OP \
|
||||
, (BOOST_PP_SEQ_NIL)(macro0)(macro1)(data) \
|
||||
, BOOST_PP_SEQ_FOLD_LEFT( \
|
||||
BOOST_PARAMETER_AUX_PP_AUGMENT_BINARY_SEQ_INDEX_FOLD_OP \
|
||||
, BOOST_PP_EMPTY() \
|
||||
, seq \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
12
include/boost/parameter/aux_/preprocessor/flatten.hpp
Normal file
12
include/boost/parameter/aux_/preprocessor/flatten.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright Daniel Wallin 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_FLATTEN_051217_HPP
|
||||
#define BOOST_PARAMETER_FLATTEN_051217_HPP
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/flatten.hpp>
|
||||
|
||||
#endif // include guard
|
||||
|
||||
12
include/boost/parameter/aux_/preprocessor/for_each.hpp
Normal file
12
include/boost/parameter/aux_/preprocessor/for_each.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright Daniel Wallin 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_FOR_EACH_051217_HPP
|
||||
#define BOOST_PARAMETER_FOR_EACH_051217_HPP
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/for_each.hpp>
|
||||
|
||||
#endif // include guard
|
||||
|
||||
1029
include/boost/parameter/aux_/preprocessor/for_each_pred.hpp
Normal file
1029
include/boost/parameter/aux_/preprocessor/for_each_pred.hpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARGUMENT_SPECS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARGUMENT_SPECS_HPP
|
||||
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
// Accessor macros for the argument specs tuple.
|
||||
#define BOOST_PARAMETER_FN_ARG_QUALIFIER(x) BOOST_PP_TUPLE_ELEM(4, 0, x)
|
||||
#define BOOST_PARAMETER_FN_ARG_KEYWORD(x) BOOST_PP_TUPLE_ELEM(4, 1, x)
|
||||
#define BOOST_PARAMETER_FN_ARG_PRED(x) BOOST_PP_TUPLE_ELEM(4, 2, x)
|
||||
#define BOOST_PARAMETER_FN_ARG_DEFAULT(x) BOOST_PP_TUPLE_ELEM(4, 3, x)
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/qualifier.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_FN_ARG_NAME(x) \
|
||||
BOOST_PARAMETER_UNQUALIFIED(BOOST_PARAMETER_FN_ARG_KEYWORD(x))
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARITY_RANGE_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_ARITY_RANGE_HPP
|
||||
|
||||
// Helper macros for BOOST_PARAMETER_ARITY_RANGE.
|
||||
#define BOOST_PARAMETER_ARITY_RANGE_M_optional(state) state
|
||||
#define BOOST_PARAMETER_ARITY_RANGE_M_deduced_optional(state) state
|
||||
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_ARITY_RANGE_M_required(state) BOOST_PP_INC(state)
|
||||
#define BOOST_PARAMETER_ARITY_RANGE_M_deduced_required(state) \
|
||||
BOOST_PP_INC(state)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_ARITY_RANGE_M(s, state, x) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_ARITY_RANGE_M_ \
|
||||
, BOOST_PARAMETER_FN_ARG_QUALIFIER(x) \
|
||||
)(state)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/seq/fold_left.hpp>
|
||||
#include <boost/preprocessor/seq/size.hpp>
|
||||
|
||||
// Calculates [begin, end) arity range.
|
||||
#define BOOST_PARAMETER_ARITY_RANGE(args) \
|
||||
( \
|
||||
BOOST_PP_SEQ_FOLD_LEFT(BOOST_PARAMETER_ARITY_RANGE_M, 0, args) \
|
||||
, BOOST_PP_INC(BOOST_PP_SEQ_SIZE(args)) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
143
include/boost/parameter/aux_/preprocessor/impl/flatten.hpp
Normal file
143
include/boost/parameter/aux_/preprocessor/impl/flatten.hpp
Normal file
@@ -0,0 +1,143 @@
|
||||
// Copyright Daniel Wallin 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FLATTEN_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FLATTEN_HPP
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_required required,
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_optional optional,
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_deduced deduced,
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_IDENTITY(x) x
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0_DUMMY_ELEM(z, n, data) ~
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT(sub) \
|
||||
BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT_, sub)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AS_DEDUCED(x) \
|
||||
BOOST_PP_CAT(deduced_, x)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/detail/split.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(sub) \
|
||||
BOOST_PP_SPLIT(0, BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT(sub))
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_ARGS(sub) \
|
||||
BOOST_PP_SPLIT(1, BOOST_PARAMETER_AUX_PP_FLATTEN_SPLIT(sub))
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_optional(arities) \
|
||||
BOOST_PP_TUPLE_ELEM(3, 0, arities)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_required(arities) \
|
||||
BOOST_PP_TUPLE_ELEM(3, 1, arities)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing.hpp>
|
||||
#include <boost/preprocessor/tuple/rem.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0(r, n, elem, data) \
|
||||
(( \
|
||||
BOOST_PP_TUPLE_ELEM(3, 2, data) \
|
||||
, BOOST_PP_TUPLE_REM(BOOST_PP_TUPLE_ELEM(3, 0, data)) elem \
|
||||
BOOST_PP_ENUM_TRAILING( \
|
||||
BOOST_PP_SUB( \
|
||||
BOOST_PP_TUPLE_ELEM(3, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(3, 0, data) \
|
||||
) \
|
||||
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0_DUMMY_ELEM \
|
||||
, ~ \
|
||||
) \
|
||||
))
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/for_each.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AUX( \
|
||||
r, arity, max_arity, spec, xform \
|
||||
) \
|
||||
BOOST_PARAMETER_AUX_PP_FOR_EACH_R( \
|
||||
r \
|
||||
, arity \
|
||||
, BOOST_PARAMETER_AUX_PP_FLATTEN_ARGS(spec) \
|
||||
, ( \
|
||||
arity \
|
||||
, max_arity \
|
||||
, xform(BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec)) \
|
||||
) \
|
||||
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC0 \
|
||||
)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_optional(r, arities, spec) \
|
||||
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AUX( \
|
||||
r \
|
||||
, BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_ \
|
||||
, BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec) \
|
||||
)(arities) \
|
||||
, BOOST_PP_TUPLE_ELEM(3, 2, arities) \
|
||||
, spec \
|
||||
, BOOST_PARAMETER_AUX_PP_FLATTEN_IDENTITY \
|
||||
)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_required(r, arities, spec) \
|
||||
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_optional(r, arities, spec)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_deduced_M(r, arities, n, spec) \
|
||||
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AUX( \
|
||||
r \
|
||||
, BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_AUX_PP_FLATTEN_ARITY_ \
|
||||
, BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec) \
|
||||
)(arities) \
|
||||
, BOOST_PP_TUPLE_ELEM(3, 2, arities) \
|
||||
, spec \
|
||||
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_AS_DEDUCED \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/seq/for_each_i.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_deduced(r, arities, spec) \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
r \
|
||||
, BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_deduced_M \
|
||||
, arities \
|
||||
, BOOST_PARAMETER_AUX_PP_FLATTEN_ARGS(spec) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC(r, arities, spec) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC_ \
|
||||
, BOOST_PARAMETER_AUX_PP_FLATTEN_QUALIFIER(spec) \
|
||||
)(r, arities, spec)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/seq/for_each.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FLATTEN( \
|
||||
opt_arity, req_arity, wanted_arity, specs \
|
||||
) \
|
||||
BOOST_PP_SEQ_FOR_EACH( \
|
||||
BOOST_PARAMETER_AUX_PP_FLATTEN_SPEC \
|
||||
, (opt_arity, req_arity, wanted_arity) \
|
||||
, specs \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
152
include/boost/parameter/aux_/preprocessor/impl/for_each.hpp
Normal file
152
include/boost/parameter/aux_/preprocessor/impl/for_each.hpp
Normal file
@@ -0,0 +1,152 @@
|
||||
// Copyright Daniel Wallin 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FOR_EACH_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FOR_EACH_HPP
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux2(x, y) (x, y), ~
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux3(x, y, z) (x, y, z), ~
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux4(x, y, z, u) (x, y, z, u), ~
|
||||
|
||||
#define \
|
||||
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_BOOST_PARAMETER_AUX_PP_FOR_EACH_END_S
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/detail/split.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_SPLIT_FIRST(x) \
|
||||
BOOST_PP_SPLIT(0, x)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_head(n, x) \
|
||||
BOOST_PP_SPLIT( \
|
||||
0 \
|
||||
, BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FOR_EACH_head_aux, n) x \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
#include <boost/preprocessor/logical/not.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x) \
|
||||
BOOST_PP_NOT(BOOST_PP_IS_EMPTY( \
|
||||
BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_, x) \
|
||||
)), ~
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux2(x, y) \
|
||||
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux3(x, y, z) \
|
||||
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux4(x, y, z, u) \
|
||||
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux_check(x)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux0(n, x) \
|
||||
BOOST_PP_CAT(BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux, n) x
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred(r, state) \
|
||||
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_SPLIT_FIRST( \
|
||||
BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux0( \
|
||||
BOOST_PP_TUPLE_ELEM(5, 3, state) \
|
||||
, BOOST_PP_TUPLE_ELEM(5, 0, state) \
|
||||
) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#else // !(BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC())
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_pred(r, state) \
|
||||
BOOST_PP_SPLIT( \
|
||||
0 \
|
||||
, BOOST_PARAMETER_AUX_PP_FOR_EACH_pred_aux0( \
|
||||
BOOST_PP_TUPLE_ELEM(5, 3, state) \
|
||||
, BOOST_PP_TUPLE_ELEM(5, 0, state) \
|
||||
) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
||||
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_op(r, state) \
|
||||
( \
|
||||
BOOST_PP_TUPLE_EAT(BOOST_PP_TUPLE_ELEM(5, 3, state)) \
|
||||
BOOST_PP_TUPLE_ELEM(5, 0, state) \
|
||||
, BOOST_PP_TUPLE_ELEM(5, 1, state) \
|
||||
, BOOST_PP_TUPLE_ELEM(5, 2, state) \
|
||||
, BOOST_PP_TUPLE_ELEM(5, 3, state) \
|
||||
, BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(5, 4, state)) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_macro(r, state) \
|
||||
BOOST_PP_TUPLE_ELEM(5, 2, state)( \
|
||||
r \
|
||||
, BOOST_PP_TUPLE_ELEM(5, 4, state) \
|
||||
, BOOST_PARAMETER_AUX_PP_FOR_EACH_head( \
|
||||
BOOST_PP_TUPLE_ELEM(5, 3, state) \
|
||||
, BOOST_PP_TUPLE_ELEM(5, 0, state) \
|
||||
) \
|
||||
, BOOST_PP_TUPLE_ELEM(5, 1, state) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel(z, n, text) \
|
||||
BOOST_PP_COMMA_IF(n) BOOST_PARAMETER_AUX_PP_FOR_EACH_END_S
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel_tuple(arity) \
|
||||
( \
|
||||
BOOST_PP_REPEAT( \
|
||||
arity, BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel, _ \
|
||||
) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/repetition/for.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH_R(r, arity, list, data, macro) \
|
||||
BOOST_PP_CAT(BOOST_PP_FOR_, r)( \
|
||||
(list \
|
||||
BOOST_PARAMETER_AUX_PP_FOR_EACH_build_end_sentinel_tuple(arity) \
|
||||
, data \
|
||||
, macro \
|
||||
, arity \
|
||||
, 0 \
|
||||
) \
|
||||
, BOOST_PARAMETER_AUX_PP_FOR_EACH_pred \
|
||||
, BOOST_PARAMETER_AUX_PP_FOR_EACH_op \
|
||||
, BOOST_PARAMETER_AUX_PP_FOR_EACH_macro \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/repetition/deduce_r.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_AUX_PP_FOR_EACH(arity, list, data, macro) \
|
||||
BOOST_PARAMETER_AUX_PP_FOR_EACH_R( \
|
||||
BOOST_PP_DEDUCE_R(), arity, list, data, macro \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,509 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FORWARDING_OVERLOADS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FORWARDING_OVERLOADS_HPP
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
// Expands to a forwarding parameter for a constructor or forwarding function.
|
||||
#define BOOST_PARAMETER_FUNCTION_ARG_TYPE_Z(z, n, type_prefix) \
|
||||
BOOST_PP_CAT(type_prefix, n)&&
|
||||
/**/
|
||||
|
||||
#include <utility>
|
||||
|
||||
// Expands to an argument passed from a forwarding function to the front-end
|
||||
// implementation function, or from a constructor to its delegate.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z(z, n, type_prefix) \
|
||||
::std::forward<BOOST_PP_CAT(type_prefix, n)>(BOOST_PP_CAT(a, n))
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
// Expands to the default constructor, whose job is to pass an empty back to
|
||||
// the delegate constructor of the base class.
|
||||
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_0_Z(z, n, data) \
|
||||
inline BOOST_PP_TUPLE_ELEM(2, 0, data)() \
|
||||
: BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
|
||||
BOOST_PP_CAT(constructor_parameters, __LINE__)()() \
|
||||
) \
|
||||
{ \
|
||||
}
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/pp_impl/argument_pack.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
|
||||
#include <boost/preprocessor/control/expr_if.hpp>
|
||||
|
||||
// Expands to a 0-arity forwarding function, whose job is to pass an empty
|
||||
// pack to the front-end implementation function.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_Z(z, n, data) \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
|
||||
inline BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)< \
|
||||
::boost::parameter::aux::argument_pack< \
|
||||
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
) \
|
||||
>::type \
|
||||
>::type \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(3, 0, data))() \
|
||||
BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
|
||||
BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)( \
|
||||
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)()() \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/function_forward_match.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
|
||||
// Expands to a forwarding function, whose job is to consolidate its arguments
|
||||
// into a pack for the front-end implementation function to take in.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_1_Z(z, n, data) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename ParameterArgumentType)> \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
|
||||
inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)< \
|
||||
typename ::boost::parameter::aux::argument_pack< \
|
||||
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
) \
|
||||
, BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
|
||||
n \
|
||||
, BOOST_PARAMETER_FUNCTION_ARG_TYPE_Z \
|
||||
, ParameterArgumentType \
|
||||
) \
|
||||
>::type \
|
||||
>::type \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_NAME(BOOST_PP_TUPLE_ELEM(4, 0, data))( \
|
||||
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, ParameterArgumentType, && a) \
|
||||
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z( \
|
||||
z \
|
||||
, BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
) \
|
||||
, n \
|
||||
, ParameterArgumentType \
|
||||
) \
|
||||
) BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
|
||||
BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)( \
|
||||
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)()( \
|
||||
BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
|
||||
n \
|
||||
, BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z \
|
||||
, ParameterArgumentType \
|
||||
) \
|
||||
) \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
|
||||
// Expands to a constructor whose job is to consolidate its arguments into a
|
||||
// pack for the delegate constructor of the base class to take in.
|
||||
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_1_Z(z, n, data) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename ParameterArgumentType)> \
|
||||
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) \
|
||||
inline BOOST_PP_TUPLE_ELEM(2, 0, data)( \
|
||||
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, ParameterArgumentType, && a) \
|
||||
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z( \
|
||||
z \
|
||||
, BOOST_PP_CAT(constructor_parameters, __LINE__) \
|
||||
, n \
|
||||
, ParameterArgumentType \
|
||||
) \
|
||||
) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
|
||||
BOOST_PP_CAT(constructor_parameters, __LINE__)()( \
|
||||
BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
|
||||
n \
|
||||
, BOOST_PARAMETER_FUNCTION_FORWARD_PARAM_Z \
|
||||
, ParameterArgumentType \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
{ \
|
||||
}
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z(z, n, data) \
|
||||
BOOST_PP_IF( \
|
||||
n \
|
||||
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_1_Z \
|
||||
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_Z \
|
||||
)(z, n, data)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
|
||||
BOOST_PP_IF( \
|
||||
n \
|
||||
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_1_Z \
|
||||
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_0_Z \
|
||||
)(z, n, data)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
|
||||
// Helper macro for BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(nm, impl, r, is_m, c) \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, r) \
|
||||
, BOOST_PP_TUPLE_ELEM(2, 1, r) \
|
||||
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z \
|
||||
, ( \
|
||||
nm \
|
||||
, impl \
|
||||
, BOOST_PP_IF( \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(nm) \
|
||||
, 0 \
|
||||
, is_m \
|
||||
) \
|
||||
, c \
|
||||
) \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Helper macro for BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS.
|
||||
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(class_, base, range) \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, range) \
|
||||
, BOOST_PP_TUPLE_ELEM(2, 1, range) \
|
||||
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z \
|
||||
, (class_, base) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/arity_range.hpp>
|
||||
|
||||
// Expands to the layer of forwarding functions for the function with the
|
||||
// specified name, whose arguments determine the range of arities.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, impl, a, is_m, c) \
|
||||
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX( \
|
||||
name, impl, BOOST_PARAMETER_ARITY_RANGE(a), is_m, c \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Expands to the layer of forwarding functions for the constructor in the
|
||||
// specified class, whose arguments determine the range of arities.
|
||||
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS(class_, base, args) \
|
||||
BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX( \
|
||||
class_, base, BOOST_PARAMETER_ARITY_RANGE(args) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
|
||||
#include <boost/preprocessor/seq/seq.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
// Expands to the default constructor, whose job is to pass an empty argument
|
||||
// pack back to the delegate constructor of the base class.
|
||||
#define BOOST_PARAMETER_DEFAULT_CONSTRUCTOR(z, n, seq) \
|
||||
inline \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)))() \
|
||||
: BOOST_PARAMETER_PARENTHESIZED_TYPE( \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
2, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
)(BOOST_PP_CAT(constructor_parameters, __LINE__)()()) \
|
||||
{ \
|
||||
}
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/pp_impl/argument_pack.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
|
||||
#include <boost/preprocessor/control/expr_if.hpp>
|
||||
|
||||
// Expands to a 0-arity forwarding function, whose job is to pass an empty
|
||||
// argument pack to the front-end implementation function.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_ARITY(z, n, seq) \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
) \
|
||||
inline BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
, BOOST_PP_TUPLE_ELEM( \
|
||||
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
)< \
|
||||
::boost::parameter::aux::argument_pack< \
|
||||
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
, BOOST_PP_TUPLE_ELEM( \
|
||||
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
) \
|
||||
>::type \
|
||||
>::type \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
4, 0, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
)() BOOST_PP_EXPR_IF( \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
, const \
|
||||
) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF( \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
4, 2, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
, this-> \
|
||||
) BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
, BOOST_PP_TUPLE_ELEM( \
|
||||
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
)( \
|
||||
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
4, 1, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
, BOOST_PP_TUPLE_ELEM( \
|
||||
4, 3, BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
) \
|
||||
)()() \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/binary_seq_to_args.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/impl/function_forward_match.hpp>
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/seq/size.hpp>
|
||||
|
||||
// Expands to a constructor whose job is to consolidate its arguments into a
|
||||
// pack for the delegate constructor of the base class to take in. Each
|
||||
// element in BOOST_PP_SEQ_TAIL(seq) determines the const-ness of the
|
||||
// corresponding argument.
|
||||
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_R(r, seq) \
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
, typename ParameterArgumentType \
|
||||
) \
|
||||
> \
|
||||
BOOST_PP_EXPR_IF( \
|
||||
BOOST_PP_EQUAL(BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), 1) \
|
||||
, explicit \
|
||||
) \
|
||||
inline BOOST_PP_TUPLE_ELEM(2, 0, BOOST_PP_SEQ_HEAD(seq))( \
|
||||
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
|
||||
BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType)(a) \
|
||||
) \
|
||||
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH( \
|
||||
BOOST_PP_CAT(constructor_parameters, __LINE__) \
|
||||
, BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
, ParameterArgumentType \
|
||||
) \
|
||||
) : BOOST_PARAMETER_PARENTHESIZED_TYPE( \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
)( \
|
||||
BOOST_PP_CAT(constructor_parameters, __LINE__)()( \
|
||||
BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), a \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
{ \
|
||||
}
|
||||
/**/
|
||||
|
||||
// Expands to a forwarding function, whose job is to consolidate its arguments
|
||||
// into a pack for the front-end implementation function to take in. Each
|
||||
// element in BOOST_PP_SEQ_TAIL(seq) determines the const-ness of the
|
||||
// corresponding argument.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_R(r, seq) \
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
, typename ParameterArgumentType \
|
||||
) \
|
||||
> \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
) \
|
||||
inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
)< \
|
||||
typename ::boost::parameter::aux::argument_pack< \
|
||||
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
) \
|
||||
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
|
||||
BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType) \
|
||||
) \
|
||||
>::type \
|
||||
>::type \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 0, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
)( \
|
||||
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
|
||||
BOOST_PP_SEQ_TAIL(seq), (ParameterArgumentType)(a) \
|
||||
) \
|
||||
BOOST_PARAMETER_FUNCTION_FORWARD_MATCH( \
|
||||
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
) \
|
||||
, BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)) \
|
||||
, ParameterArgumentType \
|
||||
) \
|
||||
) BOOST_PP_EXPR_IF( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)), const \
|
||||
) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 2, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
, this-> \
|
||||
) BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
)( \
|
||||
BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_HEAD(seq)) \
|
||||
)()( \
|
||||
BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(seq)), a \
|
||||
) \
|
||||
) \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/binary_seq_for_each.hpp>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
|
||||
// Expands to all constructors that take in n arguments. Enables
|
||||
// BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX to use
|
||||
// BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z within BOOST_PP_REPEAT_FROM_TO.
|
||||
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
|
||||
BOOST_PP_IF( \
|
||||
n \
|
||||
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_FOR_EACH_Z \
|
||||
, BOOST_PARAMETER_DEFAULT_CONSTRUCTOR \
|
||||
)(z, n, (BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_R)(data))
|
||||
/**/
|
||||
|
||||
// Expands to all forwarding functions that take in n arguments. Enables
|
||||
// BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX to use
|
||||
// BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z within BOOST_PP_REPEAT_FROM_TO.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z(z, n, data) \
|
||||
BOOST_PP_IF( \
|
||||
n \
|
||||
, BOOST_PARAMETER_AUX_PP_BINARY_SEQ_FOR_EACH_Z \
|
||||
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_0_ARITY \
|
||||
)(z, n, (BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_R)(data))
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
|
||||
// Helper macro for BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS.
|
||||
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX(class_, base, range) \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, range) \
|
||||
, BOOST_PP_TUPLE_ELEM(2, 1, range) \
|
||||
, BOOST_PARAMETER_CONSTRUCTOR_OVERLOAD_Z \
|
||||
, (class_, base) \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Helper macro for BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX(nm, impl, r, is_m, c) \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, r) \
|
||||
, BOOST_PP_TUPLE_ELEM(2, 1, r) \
|
||||
, BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOAD_Z \
|
||||
, ( \
|
||||
nm \
|
||||
, impl \
|
||||
, BOOST_PP_IF( \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(impl) \
|
||||
, 0 \
|
||||
, is_m \
|
||||
) \
|
||||
, c \
|
||||
) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/arity_range.hpp>
|
||||
|
||||
// Expands to the layer of forwarding functions for the constructor in the
|
||||
// specified class, whose arguments determine the range of arities.
|
||||
#define BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS(class_, base, args) \
|
||||
BOOST_PARAMETER_CONSTRUCTOR_OVERLOADS_AUX( \
|
||||
class_ \
|
||||
, base \
|
||||
, BOOST_PARAMETER_ARITY_RANGE(args) \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Expands to the layer of forwarding functions for the function with the
|
||||
// specified name, whose arguments determine the range of arities.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS(name, impl, a, is_m, c) \
|
||||
BOOST_PARAMETER_FUNCTION_FORWARD_OVERLOADS_AUX( \
|
||||
name \
|
||||
, impl \
|
||||
, BOOST_PARAMETER_ARITY_RANGE(a) \
|
||||
, is_m \
|
||||
, c \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
#endif // include guard
|
||||
|
||||
730
include/boost/parameter/aux_/preprocessor/impl/function_cast.hpp
Normal file
730
include/boost/parameter/aux_/preprocessor/impl/function_cast.hpp
Normal file
@@ -0,0 +1,730 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_CAST_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_CAST_HPP
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Handles possible implicit casts. Used by preprocessor.hpp
|
||||
// to normalize user input.
|
||||
//
|
||||
// cast<void*>::execute() is identity
|
||||
// cast<void*(X)>::execute() is identity
|
||||
// cast<void(X)>::execute() casts to X
|
||||
//
|
||||
// preprocessor.hpp uses this like this:
|
||||
//
|
||||
// #define X(value, predicate)
|
||||
// cast<void predicate>::execute(value)
|
||||
//
|
||||
// X(something, *)
|
||||
// X(something, *(predicate))
|
||||
// X(something, (int))
|
||||
template <typename VoidExpr, typename Args>
|
||||
struct cast;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/use_default_tag.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T, typename B>
|
||||
inline ::boost::parameter::aux::use_default_tag
|
||||
forward(::boost::parameter::aux::use_default_tag)
|
||||
{
|
||||
return ::boost::parameter::aux::use_default_tag();
|
||||
}
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Args>
|
||||
struct cast<void*,Args>
|
||||
{
|
||||
template <typename T, typename B>
|
||||
struct apply
|
||||
{
|
||||
typedef typename ::boost::mpl
|
||||
::if_<B,T,::boost::mpl::true_>::type type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename T, typename B>
|
||||
using fn = ::boost::mp11::mp_if<B,T,::boost::mp11::mp_true>;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Predicate, typename Args>
|
||||
struct cast<void*(Predicate),Args>
|
||||
: ::boost::parameter::aux::cast<void*,Args>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// This is a hack used in cast<> to turn the user supplied type,
|
||||
// which may or may not be a placeholder expression, into one,
|
||||
// so that it will be properly evaluated by mpl::apply.
|
||||
template <typename T, typename Dummy = ::boost::mpl::_1>
|
||||
struct as_placeholder_expr
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/list.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Target, typename Source, typename Args>
|
||||
struct apply_target_fn
|
||||
{
|
||||
using type = ::boost::mp11
|
||||
::mp_apply_q<Target,::boost::mp11::mp_list<Source,Args> >;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/mpl/apply.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/parameter/aux_/has_nested_template_fn.hpp>
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Target, typename Source, typename Args>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using is_target_same_as_source = ::std::is_same<
|
||||
typename ::std::remove_const<
|
||||
typename ::std::remove_reference<
|
||||
typename ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::has_nested_template_fn<Target>
|
||||
, ::boost::parameter::aux
|
||||
::apply_target_fn<Target,Source,Args>
|
||||
, ::boost::mpl::apply2<
|
||||
::boost::parameter::aux::as_placeholder_expr<Target>
|
||||
, Source
|
||||
, Args
|
||||
>
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
, typename ::std::remove_const<Source>::type
|
||||
>;
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
struct is_target_same_as_source
|
||||
: ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename ::boost::remove_const<
|
||||
typename ::boost::remove_reference<
|
||||
typename ::boost::mpl::apply2<
|
||||
::boost::parameter::aux
|
||||
::as_placeholder_expr<Target>
|
||||
, Source
|
||||
, Args
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
, typename ::boost::remove_const<Source>::type
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Covers the case where is_convertible<Source,Target> but not
|
||||
// is_same<Source,Target>. Use cases are covered
|
||||
// by test/normalize_argument_types.cpp
|
||||
template <typename Source, typename Target>
|
||||
class cast_convert
|
||||
{
|
||||
typedef ::boost::parameter::aux::cast_convert<Source,Target> _self;
|
||||
|
||||
public:
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = typename ::boost::mp11::mp_if<
|
||||
::std::is_const<Source>
|
||||
, ::std::add_const<Target>
|
||||
, ::std::remove_const<Target>
|
||||
>::type;
|
||||
#else
|
||||
typedef typename boost::mpl::eval_if<
|
||||
::boost::is_const<Source>
|
||||
, ::boost::add_const<Target>
|
||||
, ::boost::remove_const<Target>
|
||||
>::type type;
|
||||
#endif
|
||||
|
||||
private:
|
||||
inline static typename _self::type
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
_copy(typename ::std::remove_const<Target>::type value)
|
||||
#else
|
||||
_copy(typename ::boost::remove_const<Target>::type value)
|
||||
#endif
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public:
|
||||
inline static typename _self::type evaluate(Source&& source)
|
||||
{
|
||||
return _self::_copy(source);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Target, typename Source, typename Args>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using cast_impl = ::std::remove_reference<
|
||||
typename ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::has_nested_template_fn<Target>
|
||||
, ::boost::parameter::aux
|
||||
::is_target_same_as_source<Target,Source,Args>
|
||||
, ::boost::mpl::apply2<
|
||||
::boost::parameter::aux::as_placeholder_expr<Target>
|
||||
, Source
|
||||
, Args
|
||||
>
|
||||
>::type
|
||||
>;
|
||||
#else
|
||||
struct cast_impl
|
||||
: ::boost::remove_reference<
|
||||
typename ::boost::mpl::apply2<
|
||||
::boost::parameter::aux::as_placeholder_expr<Target>
|
||||
, Source
|
||||
, Args
|
||||
>::type
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Target, typename Args>
|
||||
struct cast<void(Target),Args>
|
||||
{
|
||||
template <typename T, typename B>
|
||||
struct apply
|
||||
{
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
B
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::parameter::aux
|
||||
::is_target_same_as_source<Target,T,Args>
|
||||
, ::boost::mpl::identity<T>
|
||||
, ::boost::parameter::aux::cast_impl<Target,T,Args>
|
||||
>
|
||||
, ::boost::parameter::aux
|
||||
::is_target_same_as_source<Target,T,Args>
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename T, typename B>
|
||||
using fn = typename ::boost::mp11::mp_if<
|
||||
B
|
||||
, ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux
|
||||
::is_target_same_as_source<Target,T,Args>
|
||||
, ::boost::mp11::mp_identity<T>
|
||||
, ::boost::parameter::aux::cast_impl<Target,T,Args>
|
||||
>
|
||||
, ::boost::parameter::aux
|
||||
::is_target_same_as_source<Target,T,Args>
|
||||
>::type;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/value_type.hpp>
|
||||
|
||||
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mpl/apply_wrap.hpp>
|
||||
#endif
|
||||
|
||||
// Expands to the target type of the argument as indicated by the predicate.
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#define BOOST_PARAMETER_FUNCTION_CAST_T(tag, predicate, args) \
|
||||
::boost::mp11::mp_apply_q< \
|
||||
::boost::parameter::aux::cast<void predicate, args> \
|
||||
, ::boost::mp11::mp_list< \
|
||||
typename ::boost::parameter::value_type< \
|
||||
args \
|
||||
, tag \
|
||||
, ::boost::parameter::aux::use_default_tag \
|
||||
>::type \
|
||||
, ::boost::mp11::mp_true \
|
||||
> \
|
||||
>
|
||||
/**/
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#define BOOST_PARAMETER_FUNCTION_CAST_T(tag, predicate, args) \
|
||||
typename ::boost::mpl::apply_wrap2< \
|
||||
::boost::parameter::aux::cast<void predicate, args> \
|
||||
, typename ::boost::parameter::value_type< \
|
||||
args \
|
||||
, tag \
|
||||
, ::boost::parameter::aux::use_default_tag \
|
||||
>::type \
|
||||
, ::boost::mpl::true_ \
|
||||
>::type
|
||||
/**/
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
// Expands to boost::mpl::true_ if and only if the argument's source and
|
||||
// target types are the same.
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#define BOOST_PARAMETER_FUNCTION_CAST_B(tag, predicate, args) \
|
||||
::boost::mp11::mp_apply_q< \
|
||||
::boost::parameter::aux::cast<void predicate, args> \
|
||||
, ::boost::mp11::mp_list< \
|
||||
typename ::boost::parameter::value_type< \
|
||||
args \
|
||||
, tag \
|
||||
, ::boost::parameter::aux::use_default_tag \
|
||||
>::type \
|
||||
, ::boost::mp11::mp_false \
|
||||
> \
|
||||
>
|
||||
/**/
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#define BOOST_PARAMETER_FUNCTION_CAST_B(tag, predicate, args) \
|
||||
typename ::boost::mpl::apply_wrap2< \
|
||||
::boost::parameter::aux::cast<void predicate, args> \
|
||||
, typename ::boost::parameter::value_type< \
|
||||
args \
|
||||
, tag \
|
||||
, ::boost::parameter::aux::use_default_tag \
|
||||
>::type \
|
||||
, ::boost::mpl::false_ \
|
||||
>::type
|
||||
/**/
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <utility>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// If the source and target types are not the same,
|
||||
// then perform an implicit conversion.
|
||||
template <typename Target, typename B, typename Source>
|
||||
inline typename ::boost::lazy_disable_if<
|
||||
B
|
||||
, ::boost::parameter::aux::cast_convert<Source,Target>
|
||||
>::type
|
||||
forward(Source&& source)
|
||||
{
|
||||
return ::boost::parameter::aux::cast_convert<Source,Target>
|
||||
::evaluate(::std::forward<Source>(source));
|
||||
}
|
||||
|
||||
// If the source and target types are the same,
|
||||
// then simply forward the argument.
|
||||
// However, treat rvalue references to scalars as const lvalue references.
|
||||
template <typename T, typename B>
|
||||
inline typename ::boost::enable_if<B,T const&>::type forward(T const& t)
|
||||
{
|
||||
return t;
|
||||
}
|
||||
|
||||
template <typename T, typename B>
|
||||
inline typename ::boost::enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
B
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_const<T>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
, ::boost::mp11::mp_false
|
||||
>
|
||||
#else
|
||||
typename ::boost::mpl::eval_if<
|
||||
B
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_const<T>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, T&
|
||||
>::type
|
||||
forward(T& t)
|
||||
{
|
||||
return t;
|
||||
}
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T, typename B>
|
||||
inline typename ::boost::enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
B
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_scalar<T>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
, ::boost::mp11::mp_false
|
||||
>
|
||||
#else
|
||||
typename ::boost::mpl::eval_if<
|
||||
B
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_scalar<T>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, T const&&
|
||||
>::type
|
||||
forward(T const&& t)
|
||||
{
|
||||
return static_cast<T const&&>(t);
|
||||
}
|
||||
|
||||
template <typename T, typename B>
|
||||
inline typename ::boost::enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
B
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_scalar<T>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
, ::boost::mp11::mp_false
|
||||
>
|
||||
#else
|
||||
typename ::boost::mpl::eval_if<
|
||||
B
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_scalar<T>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, T&&
|
||||
>::type
|
||||
forward(T&& t)
|
||||
{
|
||||
return ::std::forward<T>(t);
|
||||
}
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
#define BOOST_PARAMETER_FUNCTION_CAST_T(value_t, predicate, args) value_t
|
||||
#define BOOST_PARAMETER_FUNCTION_CAST_B(value, predicate, args) value
|
||||
#else // no perfect forwarding support and no Borland workarounds needed
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Handles possible implicit casts. Used by preprocessor.hpp
|
||||
// to normalize user input.
|
||||
//
|
||||
// cast<void*>::execute() is identity
|
||||
// cast<void*(X)>::execute() is identity
|
||||
// cast<void(X)>::execute() casts to X
|
||||
//
|
||||
// preprocessor.hpp uses this like this:
|
||||
//
|
||||
// #define X(value, predicate)
|
||||
// cast<void predicate>::execute(value)
|
||||
//
|
||||
// X(something, *)
|
||||
// X(something, *(predicate))
|
||||
// X(something, (int))
|
||||
template <typename VoidExpr, typename Args>
|
||||
struct cast;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/use_default_tag.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Args>
|
||||
struct cast<void*,Args>
|
||||
{
|
||||
template <typename T>
|
||||
struct apply
|
||||
{
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
inline static ::boost::parameter::aux::use_default_tag
|
||||
execute(::boost::parameter::aux::use_default_tag)
|
||||
{
|
||||
return ::boost::parameter::aux::use_default_tag();
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
inline static U& execute(U& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Predicate, typename Args>
|
||||
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
|
||||
struct cast< ::boost::parameter::aux::voidstar(Predicate),Args>
|
||||
#else
|
||||
struct cast<void*(Predicate),Args>
|
||||
#endif
|
||||
: ::boost::parameter::aux::cast<void*,Args>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/placeholders.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// This is a hack used in cast<> to turn the user supplied type,
|
||||
// which may or may not be a placeholder expression, into one,
|
||||
// so that it will be properly evaluated by mpl::apply.
|
||||
template <typename T, typename Dummy = ::boost::mpl::_1>
|
||||
struct as_placeholder_expr
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/apply.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Target, typename Source, typename Args>
|
||||
struct is_target_same_as_source
|
||||
: ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename ::boost::remove_const<
|
||||
typename ::boost::remove_reference<
|
||||
typename ::boost::mpl::apply2<
|
||||
::boost::parameter::aux
|
||||
::as_placeholder_expr<Target>
|
||||
, Source
|
||||
, Args
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
, typename ::boost::remove_const<Source>::type
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
|
||||
template <
|
||||
typename Target
|
||||
, typename Source
|
||||
, typename Args
|
||||
, typename Enable = ::boost::parameter::aux
|
||||
::is_target_same_as_source<Target,Source,Args>
|
||||
>
|
||||
struct cast_impl
|
||||
{
|
||||
typedef Source& type;
|
||||
|
||||
inline static Source& evaluate(Source& value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/add_lvalue_reference.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Covers the case where is_convertible<Source,Target> but not
|
||||
// is_same<Source,Target>. Use cases are covered
|
||||
// by test/normalize_argument_types.cpp
|
||||
template <typename Source, typename Target>
|
||||
class cast_convert
|
||||
{
|
||||
typedef ::boost::parameter::aux::cast_convert<Source,Target> _self;
|
||||
|
||||
public:
|
||||
typedef typename ::boost::add_lvalue_reference<
|
||||
typename ::boost::add_const<Target>::type
|
||||
>::type type;
|
||||
|
||||
private:
|
||||
template <typename U>
|
||||
inline static typename _self::type _mod_const(U const& u)
|
||||
{
|
||||
return u;
|
||||
}
|
||||
|
||||
inline static Target _copy(Target value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public:
|
||||
inline static typename _self::type evaluate(Source& source)
|
||||
{
|
||||
return _self::_mod_const(_self::_copy(source));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Target, typename Source, typename Args>
|
||||
struct cast_impl<Target,Source,Args,::boost::mpl::false_>
|
||||
: ::boost::parameter::aux::cast_convert<
|
||||
Source,
|
||||
typename ::boost::mpl::apply2<
|
||||
::boost::parameter::aux::as_placeholder_expr<Target>
|
||||
, Source
|
||||
, Args
|
||||
>::type
|
||||
>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Target, typename Args>
|
||||
struct cast<void(Target),Args>
|
||||
{
|
||||
template <typename T>
|
||||
struct apply
|
||||
{
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
::boost::parameter::aux
|
||||
::is_target_same_as_source<Target,T,Args>
|
||||
, ::boost::add_lvalue_reference<T>
|
||||
, ::boost::parameter::aux::cast_impl<
|
||||
Target
|
||||
, T
|
||||
, Args
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
>::type type;
|
||||
};
|
||||
|
||||
inline static ::boost::parameter::aux::use_default_tag
|
||||
execute(::boost::parameter::aux::use_default_tag)
|
||||
{
|
||||
return ::boost::parameter::aux::use_default_tag();
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
inline static typename ::boost::parameter::aux
|
||||
::cast_impl<Target,U const,Args>::type
|
||||
execute(U const& value)
|
||||
{
|
||||
return ::boost::parameter::aux
|
||||
::cast_impl<Target,U const,Args>::evaluate(value);
|
||||
}
|
||||
|
||||
template <typename U>
|
||||
inline static typename ::boost::parameter::aux
|
||||
::cast_impl<Target,U,Args>::type
|
||||
execute(U& value)
|
||||
{
|
||||
return ::boost::parameter::aux
|
||||
::cast_impl<Target,U,Args>::evaluate(value);
|
||||
}
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/apply_wrap.hpp>
|
||||
#include <boost/parameter/value_type.hpp>
|
||||
|
||||
// Expands to the reference-qualified target type of the argument
|
||||
// as indicated by the predicate.
|
||||
#define BOOST_PARAMETER_FUNCTION_CAST_T(tag, predicate, args) \
|
||||
typename ::boost::mpl::apply_wrap1< \
|
||||
::boost::parameter::aux::cast<void predicate, args> \
|
||||
, typename ::boost::parameter::value_type< \
|
||||
args \
|
||||
, tag \
|
||||
, ::boost::parameter::aux::use_default_tag \
|
||||
>::type \
|
||||
>::type
|
||||
/**/
|
||||
|
||||
// Expands to the converted or passed-through value
|
||||
// as indicated by the predicate.
|
||||
#define BOOST_PARAMETER_FUNCTION_CAST_B(value, predicate, args) \
|
||||
::boost::parameter::aux::cast<void predicate, args>::execute(value)
|
||||
/**/
|
||||
|
||||
#endif // perfect forwarding support, or Borland workarounds needed
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,474 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_LAYER_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_LAYER_HPP
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
// Expands to keyword_tag_type for some keyword_tag.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(keyword_tag) \
|
||||
BOOST_PP_CAT(keyword_tag, _type)
|
||||
/**/
|
||||
|
||||
// Expands to a template parameter for each dispatch function.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_TEMPLATE_ARG(r, macro, arg) \
|
||||
, typename BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg))
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
// Expands to a forwarding parameter for a dispatch function.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN(r, macro, arg) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg))&& macro(arg)
|
||||
/**/
|
||||
|
||||
#include <utility>
|
||||
|
||||
// Expands to an argument passed from one dispatch function to the next.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD(r, macro, arg) \
|
||||
, ::std::forward< \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg)) \
|
||||
>(macro(arg))
|
||||
/**/
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
// Expands to a forwarding parameter for a dispatch function. The parameter
|
||||
// type stores its const-ness.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN(r, macro, arg) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_TYPE(macro(arg))& macro(arg)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/as_lvalue.hpp>
|
||||
|
||||
// Expands to an argument passed from one dispatch function to the next.
|
||||
// Explicit forwarding takes the form of forcing the argument to be an lvalue.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD(r, macro, arg) \
|
||||
, ::boost::parameter::aux::as_lvalue(macro(arg))
|
||||
/**/
|
||||
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/impl/split_args.hpp>
|
||||
#include <boost/preprocessor/seq/for_each.hpp>
|
||||
#include <boost/preprocessor/seq/first_n.hpp>
|
||||
|
||||
// Iterates through all required arguments and the first n optional arguments,
|
||||
// passing each argument to the specified macro.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT(macro, n, split_args) \
|
||||
BOOST_PP_SEQ_FOR_EACH( \
|
||||
macro \
|
||||
, BOOST_PARAMETER_FN_ARG_NAME \
|
||||
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(split_args) \
|
||||
) \
|
||||
BOOST_PP_SEQ_FOR_EACH( \
|
||||
macro \
|
||||
, BOOST_PARAMETER_FN_ARG_NAME \
|
||||
, BOOST_PP_SEQ_FIRST_N( \
|
||||
n, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(split_args) \
|
||||
) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/function_dispatch_tuple.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
|
||||
// Produces a name for the dispatch functions.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, n) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
|
||||
, boost_param_dispatch_const_ \
|
||||
, boost_param_dispatch_ \
|
||||
) \
|
||||
, BOOST_PP_CAT(BOOST_PP_CAT(n, boost_), __LINE__) \
|
||||
) \
|
||||
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
|
||||
) \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Expands to the template parameter list of the dispatch function with all
|
||||
// required and first n optional parameters; also extracts the static keyword
|
||||
// if present.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
|
||||
template < \
|
||||
typename ResultType, typename Args \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_TEMPLATE_ARG \
|
||||
, n \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
> BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/use_default_tag.hpp>
|
||||
#include <boost/preprocessor/control/expr_if.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
|
||||
// Expands to the result type, name, parenthesized list of all required and
|
||||
// n optional parameters, and const-ness of the dispatch function; the bit
|
||||
// value b determines whether or not this dispatch function takes in
|
||||
// boost::parameter::aux::use_default_tag as its last parameter.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, b1, b2) \
|
||||
ResultType BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, b1)( \
|
||||
ResultType(*)(), Args const& args, long \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_DEFN \
|
||||
, n \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
BOOST_PP_COMMA_IF(b2) \
|
||||
BOOST_PP_EXPR_IF(b2, ::boost::parameter::aux::use_default_tag) \
|
||||
) BOOST_PP_EXPR_IF(BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x), const)
|
||||
/**/
|
||||
|
||||
// Expands to a forward declaration of the dispatch function that takes in
|
||||
// all required and the first n optional parameters, but not
|
||||
// boost::parameter::aux::use_default_tag.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_0_Z(z, n, x) \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 0);
|
||||
/**/
|
||||
|
||||
// Expands to a forward declaration of the dispatch function that takes in
|
||||
// all required parameters, the first n optional parameters, and
|
||||
// boost::parameter::aux::use_default_tag.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_1_Z(z, n, x) \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 1);
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
|
||||
// Expands to the default value of the (n + 1)th optional parameter.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT_AUX(n, s_args) \
|
||||
BOOST_PARAMETER_FN_ARG_DEFAULT( \
|
||||
BOOST_PP_SEQ_ELEM(n, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_args)) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/keyword.hpp>
|
||||
|
||||
// Expands to the assignment portion which binds the default value to the
|
||||
// (n + 1)th optional parameter before composing it with the argument-pack
|
||||
// parameter passed in to the n-th dispatch function.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT(n, s_args, tag_ns) \
|
||||
::boost::parameter::keyword< \
|
||||
tag_ns::BOOST_PARAMETER_FN_ARG_NAME( \
|
||||
BOOST_PP_SEQ_ELEM(n, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_args)) \
|
||||
) \
|
||||
>::instance = BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT_AUX(n, s_args)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/function_cast.hpp>
|
||||
|
||||
// Takes in the arg tuple (name, pred) and the tag namespace.
|
||||
// Extracts the corresponding required argument from the pack.
|
||||
// This form enables BOOST_PARAMETER_FUNCTION_DISPATCH_LAYER to use it
|
||||
// from within BOOST_PP_SEQ_FOR_EACH.
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
// The boost::parameter::aux::forward wrapper is necessary to transmit the
|
||||
// target type to the next dispatch function. Otherwise, the argument will
|
||||
// retain its original type. -- Cromwell D. Enage
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R(r, tag_ns, arg) \
|
||||
, ::boost::parameter::aux::forward< \
|
||||
BOOST_PARAMETER_FUNCTION_CAST_T( \
|
||||
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
|
||||
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
|
||||
, Args \
|
||||
) \
|
||||
, BOOST_PARAMETER_FUNCTION_CAST_B( \
|
||||
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
|
||||
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
|
||||
, Args \
|
||||
) \
|
||||
>( \
|
||||
args[ \
|
||||
::boost::parameter::keyword< \
|
||||
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
|
||||
>::instance \
|
||||
] \
|
||||
)
|
||||
/**/
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
// The explicit type cast is necessary to transmit the target type to the next
|
||||
// dispatch function. Otherwise, the argument will retain its original type.
|
||||
// -- Cromwell D. Enage
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R(r, tag_ns, arg) \
|
||||
, BOOST_PARAMETER_FUNCTION_CAST_T( \
|
||||
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
|
||||
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
|
||||
, Args \
|
||||
)( \
|
||||
args[ \
|
||||
::boost::parameter::keyword< \
|
||||
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
|
||||
>::instance \
|
||||
] \
|
||||
)
|
||||
/**/
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
|
||||
// Takes in the arg tuple (name, pred, default) and the tag namespace.
|
||||
// Extracts the corresponding optional argument from the pack if specified,
|
||||
// otherwise temporarily passes use_default_tag() to the dispatch functions.
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
// The boost::parameter::aux::forward wrapper is necessary to transmit the
|
||||
// target type to the next dispatch function. Otherwise, the argument will
|
||||
// retain its original type. -- Cromwell D. Enage
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OPT_ARG_CAST(arg, tag_ns) \
|
||||
::boost::parameter::aux::forward< \
|
||||
BOOST_PARAMETER_FUNCTION_CAST_T( \
|
||||
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
|
||||
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
|
||||
, Args \
|
||||
) \
|
||||
, BOOST_PARAMETER_FUNCTION_CAST_B( \
|
||||
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
|
||||
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
|
||||
, Args \
|
||||
) \
|
||||
>( \
|
||||
args[ \
|
||||
::boost::parameter::keyword< \
|
||||
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
|
||||
>::instance || ::boost::parameter::aux::use_default_tag() \
|
||||
] \
|
||||
)
|
||||
/**/
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OPT_ARG_CAST(arg, tag_ns) \
|
||||
BOOST_PARAMETER_FUNCTION_CAST_B( \
|
||||
args[ \
|
||||
::boost::parameter::keyword< \
|
||||
tag_ns::BOOST_PARAMETER_FN_ARG_NAME(arg) \
|
||||
>::instance || ::boost::parameter::aux::use_default_tag() \
|
||||
] \
|
||||
, BOOST_PARAMETER_FN_ARG_PRED(arg) \
|
||||
, Args \
|
||||
)
|
||||
/**/
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
|
||||
|
||||
// Expands to three dispatch functions that take in all required parameters
|
||||
// and the first n optional parameters. The third dispatch function bears
|
||||
// the same name as the first but takes in use_default_tag as the last
|
||||
// parameter. The second dispatch function bears a different name from the
|
||||
// other two.
|
||||
//
|
||||
// x is a tuple:
|
||||
//
|
||||
// (name, split_args, is_const, tag_namespace)
|
||||
//
|
||||
// Where name is the base name of the functions, and split_args is a tuple:
|
||||
//
|
||||
// (required_count, required_args, optional_count, required_args)
|
||||
//
|
||||
// The first dispatch function queries args if it has bound the (n + 1)th
|
||||
// optional parameter to a user-defined argument. If so, then it forwards
|
||||
// its own arguments followed by the user-defined argument to the dispatch
|
||||
// function that takes in all required parameters and the first (n + 1)
|
||||
// optional parameters, but not use_default_tag. Otherwise, it forwards
|
||||
// its own arguments to the third dispatch function.
|
||||
//
|
||||
// The third dispatch function appends the default value of the (n + 1)th
|
||||
// optional parameter to its copy of args. Then it forwards this copy, all
|
||||
// required parameters, and the first n (not n + 1) optional parameters to
|
||||
// the second dispatch function.
|
||||
//
|
||||
// The second dispatch function forwards its arguments, then the (n + 1)th
|
||||
// optional parameter that it extracts from args, to the other-named dispatch
|
||||
// function that takes in all required parameters and the first (n + 1)
|
||||
// optional parameters, but not use_default_tag.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_Z(z, n, x) \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
|
||||
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 0) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
|
||||
, this-> \
|
||||
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
|
||||
static_cast<ResultType(*)()>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
|
||||
, args \
|
||||
, 0L \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD \
|
||||
, n \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_OPT_ARG_CAST( \
|
||||
BOOST_PP_SEQ_ELEM( \
|
||||
n \
|
||||
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
|
||||
) \
|
||||
); \
|
||||
} \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
|
||||
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 1, 0) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
|
||||
, this-> \
|
||||
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
|
||||
static_cast<ResultType(*)()>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
|
||||
, args \
|
||||
, 0L \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD \
|
||||
, n \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
, args[ \
|
||||
::boost::parameter::keyword< \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x):: \
|
||||
BOOST_PARAMETER_FN_ARG_NAME( \
|
||||
BOOST_PP_SEQ_ELEM( \
|
||||
n \
|
||||
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
>::instance \
|
||||
] \
|
||||
); \
|
||||
} \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL(n, x) \
|
||||
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN(n, x, 0, 1) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
|
||||
, this-> \
|
||||
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 1)( \
|
||||
static_cast<ResultType(*)()>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
|
||||
, (args \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_DEFAULT( \
|
||||
n \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
|
||||
) \
|
||||
) \
|
||||
, 0L \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_REPEAT( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_FWD \
|
||||
, n \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
// x is a tuple:
|
||||
//
|
||||
// (base_name, split_args, is_member, is_const, tag_namespace)
|
||||
//
|
||||
// Generates all dispatch functions for the function named base_name. Each
|
||||
// dispatch function that takes in n optional parameters passes the default
|
||||
// value of the (n + 1)th optional parameter to the next dispatch function.
|
||||
// The last dispatch function is the back-end implementation, so only the
|
||||
// header is generated: the user is expected to supply the body.
|
||||
//
|
||||
// Also generates the front-end implementation function, which uses
|
||||
// BOOST_PARAMETER_FUNCTION_CAST to extract each argument from the argument
|
||||
// pack.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_LAYER(fwd_decl, x) \
|
||||
BOOST_PP_IF(fwd_decl, BOOST_PP_REPEAT_FROM_TO, BOOST_PP_TUPLE_EAT(4))( \
|
||||
0 \
|
||||
, BOOST_PP_INC( \
|
||||
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_0_Z \
|
||||
, x \
|
||||
) \
|
||||
BOOST_PP_IF(fwd_decl, BOOST_PP_REPEAT_FROM_TO, BOOST_PP_TUPLE_EAT(4))( \
|
||||
0 \
|
||||
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_FWD_DECL_1_Z \
|
||||
, x \
|
||||
) \
|
||||
template <typename Args> BOOST_PARAMETER_MEMBER_FUNCTION_STATIC( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
|
||||
) inline typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
|
||||
)<Args>::type BOOST_PARAMETER_FUNCTION_IMPL_NAME( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
|
||||
)(Args const& args) \
|
||||
BOOST_PP_EXPR_IF(BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x), const) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
|
||||
, this-> \
|
||||
) BOOST_PARAMETER_FUNCTION_DISPATCH_NAME(x, 0)( \
|
||||
static_cast< \
|
||||
typename BOOST_PARAMETER_FUNCTION_RESULT_NAME( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
|
||||
)<Args>::type(*)() \
|
||||
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
|
||||
, args \
|
||||
, 0L \
|
||||
BOOST_PP_SEQ_FOR_EACH( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_ARG_CAST_R \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
|
||||
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
) \
|
||||
); \
|
||||
} \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
0 \
|
||||
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
, BOOST_PARAMETER_FUNCTION_DISPATCH_OVERLOAD_Z \
|
||||
, x \
|
||||
) \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_TPL( \
|
||||
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
, x \
|
||||
) \
|
||||
inline BOOST_PARAMETER_FUNCTION_DISPATCH_HEAD_PRN( \
|
||||
BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT( \
|
||||
BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
) \
|
||||
, x \
|
||||
, 0 \
|
||||
, 0 \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_TUPLE_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_DISPATCH_TUPLE_HPP
|
||||
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
// Accessor macros for the input tuple to the dispatch macros.
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_BASE_NAME(x) \
|
||||
BOOST_PP_TUPLE_ELEM(5, 0, x)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_SPLIT_ARGS(x) \
|
||||
BOOST_PP_TUPLE_ELEM(5, 1, x)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_IS_MEMBER(x) \
|
||||
BOOST_PP_TUPLE_ELEM(5, 2, x)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_IS_CONST(x) \
|
||||
BOOST_PP_TUPLE_ELEM(5, 3, x)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_DISPATCH_TAG_NAMESPACE(x) \
|
||||
BOOST_PP_TUPLE_ELEM(5, 4, x)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_FORWARD_MATCH_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_FORWARD_MATCH_HPP
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE) && \
|
||||
!BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
|
||||
|
||||
#include <boost/parameter/aux_/pp_impl/match.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
||||
|
||||
// Expands to an extra argument that is well-formed
|
||||
// iff all Args... satisfy the requirements set by params.
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH(params, n, prefix) \
|
||||
, typename ::boost::parameter::aux::match< \
|
||||
params BOOST_PP_ENUM_TRAILING_PARAMS(n, prefix) \
|
||||
>::type = params()
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z(z, params, n, prefix) \
|
||||
, typename ::boost::parameter::aux::match< \
|
||||
params BOOST_PP_ENUM_TRAILING_PARAMS_Z(z, n, prefix) \
|
||||
>::type = params()
|
||||
/**/
|
||||
|
||||
#else // SFINAE/Borland workarounds needed.
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH(params, n, prefix) \
|
||||
, params = params()
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_FORWARD_MATCH_Z(z, params, n, prefix) \
|
||||
, params = params()
|
||||
/**/
|
||||
|
||||
#endif
|
||||
#endif // include guard
|
||||
|
||||
152
include/boost/parameter/aux_/preprocessor/impl/function_name.hpp
Normal file
152
include/boost/parameter/aux_/preprocessor/impl/function_name.hpp
Normal file
@@ -0,0 +1,152 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_NAME_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_FUNCTION_NAME_HPP
|
||||
|
||||
#define BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_static ()
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/is_nullary.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
|
||||
BOOST_PARAMETER_IS_NULLARY( \
|
||||
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_CHECK_STATIC_, name) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/seq/seq.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
|
||||
// Workaround for MSVC preprocessor.
|
||||
//
|
||||
// When stripping static from "static f", msvc will produce " f". The leading
|
||||
// whitespace doesn't go away when pasting the token with something else, so
|
||||
// this thing is a hack to strip the whitespace.
|
||||
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static (
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \
|
||||
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name))
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \
|
||||
BOOST_PP_SEQ_HEAD( \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_AUX(name) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#else
|
||||
|
||||
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_static
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC(name) \
|
||||
BOOST_PP_CAT(BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC_, name)
|
||||
/**/
|
||||
|
||||
#endif // MSVC workarounds needed
|
||||
|
||||
#include <boost/preprocessor/control/expr_if.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) \
|
||||
BOOST_PP_EXPR_IF( \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name), static \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
|
||||
BOOST_PP_IF( \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_IS_STATIC(name) \
|
||||
, BOOST_PARAMETER_MEMBER_FUNCTION_STRIP_STATIC \
|
||||
, name BOOST_PP_TUPLE_EAT(1) \
|
||||
)(name)
|
||||
/**/
|
||||
|
||||
// Produces a name for a parameter specification for the function named base.
|
||||
#define BOOST_PARAMETER_FUNCTION_SPECIFICATION_NAME(base, is_const) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_IF( \
|
||||
is_const \
|
||||
, boost_param_parameters_const_ \
|
||||
, boost_param_parameters_ \
|
||||
) \
|
||||
, __LINE__ \
|
||||
) \
|
||||
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Produces a name for a result type metafunction for the no-spec function
|
||||
// named base.
|
||||
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(base, is_const) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_IF( \
|
||||
is_const \
|
||||
, boost_param_no_spec_result_const_ \
|
||||
, boost_param_no_spec_result_ \
|
||||
) \
|
||||
, __LINE__ \
|
||||
) \
|
||||
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Produces a name for a result type metafunction for the function named base.
|
||||
#define BOOST_PARAMETER_FUNCTION_RESULT_NAME(base, is_const) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_IF( \
|
||||
is_const \
|
||||
, boost_param_result_const_ \
|
||||
, boost_param_result_ \
|
||||
) \
|
||||
, __LINE__ \
|
||||
) \
|
||||
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Produces a name for the implementation function to which the no-spec
|
||||
// function named base forwards its result type and argument pack.
|
||||
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME(base, is_const) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_IF( \
|
||||
is_const \
|
||||
, boost_param_no_spec_impl_const \
|
||||
, boost_param_no_spec_impl \
|
||||
) \
|
||||
, __LINE__ \
|
||||
) \
|
||||
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Can't do boost_param_impl_ ## basee
|
||||
// because base might start with an underscore.
|
||||
// daniel: what? how is that relevant? the reason for using CAT()
|
||||
// is to make sure base is expanded. i'm not sure we need to here,
|
||||
// but it's more stable to do it.
|
||||
#define BOOST_PARAMETER_FUNCTION_IMPL_NAME(base, is_const) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_IF(is_const, boost_param_impl_const, boost_param_impl) \
|
||||
, __LINE__ \
|
||||
) \
|
||||
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,331 @@
|
||||
// Copyright Cromwell D. Enage 2018.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_NO_SPEC_OVERLOADS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_NO_SPEC_OVERLOADS_HPP
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
|
||||
|
||||
// Defines the no-spec implementation function header.
|
||||
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_HEAD(name, is_const) \
|
||||
template <typename ResultType, typename Args> \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(name) ResultType \
|
||||
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
|
||||
name, is_const \
|
||||
)(ResultType(*)(), Args const& args)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_return_type.hpp>
|
||||
|
||||
// Expands to the result metafunction for the specified no-spec function.
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
|
||||
template <typename TaggedArg0, typename ...TaggedArgs> \
|
||||
using BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
|
||||
= typename BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result);
|
||||
/**/
|
||||
#else
|
||||
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
|
||||
template <typename TaggedArg0, typename ...TaggedArgs> \
|
||||
struct BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
|
||||
: BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result) \
|
||||
{ \
|
||||
};
|
||||
/**/
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
#include <boost/parameter/compose.hpp>
|
||||
#include <boost/parameter/are_tagged_arguments.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
// Exapnds to a variadic constructor that is enabled if and only if all its
|
||||
// arguments are tagged arguments. The enclosing class must inherit from the
|
||||
// specified base class, which in turn must implement a constructor that takes
|
||||
// in the argument pack that this one passes on.
|
||||
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(class_, base) \
|
||||
template < \
|
||||
typename TaggedArg0 \
|
||||
, typename ...TaggedArgs \
|
||||
, typename = typename ::boost::enable_if< \
|
||||
::boost::parameter \
|
||||
::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
|
||||
>::type \
|
||||
> inline explicit \
|
||||
class_(TaggedArg0 const& arg0, TaggedArgs const&... args) \
|
||||
: BOOST_PARAMETER_PARENTHESIZED_TYPE(base)( \
|
||||
::boost::parameter::compose(arg0, args...) \
|
||||
) \
|
||||
{ \
|
||||
}
|
||||
/**/
|
||||
|
||||
// Exapnds to a variadic constructor that is enabled if and only if all its
|
||||
// arguments are tagged arguments. The specified function must be able to
|
||||
// take in the argument pack that this constructor passes on.
|
||||
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(class_, func) \
|
||||
template < \
|
||||
typename TaggedArg0 \
|
||||
, typename ...TaggedArgs \
|
||||
, typename = typename ::boost::enable_if< \
|
||||
::boost::parameter \
|
||||
::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
|
||||
>::type \
|
||||
> inline explicit \
|
||||
class_(TaggedArg0 const& arg0, TaggedArgs const&... args) \
|
||||
{ \
|
||||
func(::boost::parameter::compose(arg0, args...)); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
|
||||
#include <boost/preprocessor/control/expr_if.hpp>
|
||||
|
||||
// Exapnds to a variadic function that is enabled if and only if
|
||||
// all its arguments are tagged arguments.
|
||||
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD(name, impl, is_m, c) \
|
||||
template <typename TaggedArg0, typename ...TaggedArgs> \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(impl) \
|
||||
inline typename ::boost::lazy_enable_if< \
|
||||
::boost::parameter \
|
||||
::are_tagged_arguments<TaggedArg0,TaggedArgs...> \
|
||||
, BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
|
||||
impl, c \
|
||||
)<TaggedArg0,TaggedArgs...> \
|
||||
>::type BOOST_PARAMETER_MEMBER_FUNCTION_NAME(name) \
|
||||
(TaggedArg0 const& arg0, TaggedArgs const&... args) \
|
||||
BOOST_PP_EXPR_IF(c, const) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF(is_m, this->) \
|
||||
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME(impl, c)( \
|
||||
static_cast< \
|
||||
typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
|
||||
impl, c \
|
||||
)<TaggedArg0,TaggedArgs...>::type(*)() \
|
||||
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
|
||||
, ::boost::parameter::compose(arg0, args...) \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_return_type.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
|
||||
// Expands to the result metafunction for the specified no-spec function.
|
||||
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_HEAD(result, name, is_const) \
|
||||
template < \
|
||||
BOOST_PP_ENUM_BINARY_PARAMS( \
|
||||
BOOST_PARAMETER_COMPOSE_MAX_ARITY \
|
||||
, typename TaggedArg \
|
||||
, = ::boost::parameter::void_ BOOST_PP_INTERCEPT \
|
||||
) \
|
||||
> \
|
||||
struct BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME(name, is_const) \
|
||||
: BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(result) \
|
||||
{ \
|
||||
};
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/compose.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/impl/parenthesized_type.hpp>
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
#include <boost/preprocessor/control/expr_if.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#if defined(BOOST_NO_SFINAE)
|
||||
|
||||
// Exapnds to a tagged-argument constructor overload that passes the argument
|
||||
// pack to the base class delegate constructor.
|
||||
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
|
||||
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
|
||||
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg) \
|
||||
) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
|
||||
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
|
||||
) \
|
||||
{ \
|
||||
}
|
||||
/**/
|
||||
|
||||
// Exapnds to a tagged-argument constructor overload that passes the argument
|
||||
// pack to the delegate function.
|
||||
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
|
||||
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
|
||||
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& a) \
|
||||
) \
|
||||
{ \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, data)( \
|
||||
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, a)) \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
|
||||
|
||||
// Exapnds to a tagged-argument function overload.
|
||||
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z(z, n, data) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
|
||||
inline typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 0, data) \
|
||||
)(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg)) \
|
||||
BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
|
||||
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)( \
|
||||
static_cast< \
|
||||
typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type(*)() \
|
||||
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
|
||||
, ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#else // !defined(BOOST_NO_SFINAE)
|
||||
|
||||
#include <boost/parameter/are_tagged_arguments.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
// Exapnds to a tagged-argument constructor overload that passes the argument
|
||||
// pack to the base class delegate constructor. This constructor is enabled
|
||||
// if and only if all its arguments are tagged arguments.
|
||||
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
|
||||
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
|
||||
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg) \
|
||||
, typename ::boost::enable_if< \
|
||||
::boost::parameter::are_tagged_arguments< \
|
||||
BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg) \
|
||||
> \
|
||||
>::type* = BOOST_PARAMETER_AUX_PP_NULLPTR \
|
||||
) : BOOST_PARAMETER_PARENTHESIZED_TYPE(BOOST_PP_TUPLE_ELEM(2, 1, data))( \
|
||||
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
|
||||
) \
|
||||
{ \
|
||||
}
|
||||
/**/
|
||||
|
||||
// Exapnds to a tagged-argument constructor overload that passes the argument
|
||||
// pack to the delegate function. This constructor is enabled if and only if
|
||||
// all its arguments are tagged arguments.
|
||||
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z(z, n, data) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
|
||||
BOOST_PP_EXPR_IF(BOOST_PP_EQUAL(n, 1), explicit) inline \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, data)( \
|
||||
BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& a) \
|
||||
, typename ::boost::enable_if< \
|
||||
::boost::parameter::are_tagged_arguments< \
|
||||
BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg) \
|
||||
> \
|
||||
>::type* = BOOST_PARAMETER_AUX_PP_NULLPTR \
|
||||
) \
|
||||
{ \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, data)( \
|
||||
::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, a)) \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
// Exapnds to a function overload that is enabled if and only if
|
||||
// all its arguments are tagged arguments.
|
||||
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z(z, n, data) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename TaggedArg)> \
|
||||
BOOST_PARAMETER_MEMBER_FUNCTION_STATIC(BOOST_PP_TUPLE_ELEM(4, 1, data)) \
|
||||
inline typename ::boost::lazy_enable_if< \
|
||||
::boost::parameter \
|
||||
::are_tagged_arguments<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)> \
|
||||
, BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)> \
|
||||
>::type BOOST_PARAMETER_MEMBER_FUNCTION_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 0, data) \
|
||||
)(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, TaggedArg, const& arg)) \
|
||||
BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 3, data), const) \
|
||||
{ \
|
||||
return BOOST_PP_EXPR_IF(BOOST_PP_TUPLE_ELEM(4, 2, data), this->) \
|
||||
BOOST_PARAMETER_NO_SPEC_FUNCTION_IMPL_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)( \
|
||||
static_cast< \
|
||||
typename BOOST_PARAMETER_NO_SPEC_FUNCTION_RESULT_NAME( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, data) \
|
||||
, BOOST_PP_TUPLE_ELEM(4, 3, data) \
|
||||
)<BOOST_PP_ENUM_PARAMS_Z(z, n, TaggedArg)>::type(*)() \
|
||||
>(BOOST_PARAMETER_AUX_PP_NULLPTR) \
|
||||
, ::boost::parameter::compose(BOOST_PP_ENUM_PARAMS_Z(z, n, arg)) \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#endif // BOOST_NO_SFINAE
|
||||
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
|
||||
// Emulates a variadic constructor that is enabled if and only if all its
|
||||
// arguments are tagged arguments. The enclosing class must inherit from the
|
||||
// specified base class, which in turn must implement a constructor that takes
|
||||
// in the argument pack that this one passes on.
|
||||
#define BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR(class_, base) \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
1 \
|
||||
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
|
||||
, BOOST_PARAMETER_NO_SPEC_CONSTRUCTOR_OVERLOAD_Z \
|
||||
, (class_, base) \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Emulates a variadic constructor that is enabled if and only if all its
|
||||
// arguments are tagged arguments. The specified function must be able to
|
||||
// take in the argument pack that this constructor passes on.
|
||||
#define BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR(class_, func) \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
1 \
|
||||
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
|
||||
, BOOST_PARAMETER_NO_SPEC_NO_BASE_CONSTRUCTOR_OVERLOAD_Z \
|
||||
, (class_, func) \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Emulates a variadic function that is enabled if and only if
|
||||
// all its arguments are tagged arguments.
|
||||
#define BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD(name, impl, is_m, c) \
|
||||
BOOST_PP_REPEAT_FROM_TO( \
|
||||
1 \
|
||||
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY) \
|
||||
, BOOST_PARAMETER_NO_SPEC_FUNCTION_OVERLOAD_Z \
|
||||
, (name, impl, is_m, c) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
// Copyright Cromwell D. Enage 2019.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_RETURN_TYPE_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_RETURN_TYPE_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// A metafunction that transforms void(*)(T) -> identity<T>
|
||||
template <typename UnaryFunctionPointer>
|
||||
struct unaryfunptr_return_type;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#else
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Arg>
|
||||
struct unaryfunptr_return_type<void(*)(Arg)>
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = ::boost::mp11::mp_identity<Arg>;
|
||||
#else
|
||||
typedef ::boost::mpl::identity<Arg> type;
|
||||
#endif
|
||||
};
|
||||
|
||||
template <>
|
||||
struct unaryfunptr_return_type<void(*)(void)>
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = ::boost::mp11::mp_identity<void>;
|
||||
#else
|
||||
typedef ::boost::mpl::identity<void> type;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Pred, typename Ret>
|
||||
struct unaryfunptr_return_type<void(*)(::boost::enable_if<Pred,Ret>)>
|
||||
{
|
||||
typedef ::boost::enable_if<Pred,Ret> type;
|
||||
};
|
||||
|
||||
template <bool b, typename Ret>
|
||||
struct unaryfunptr_return_type<void(*)(::boost::enable_if_c<b,Ret>)>
|
||||
{
|
||||
typedef ::boost::enable_if_c<b,Ret> type;
|
||||
};
|
||||
|
||||
template <typename Pred, typename Ret>
|
||||
struct unaryfunptr_return_type<void(*)(::boost::lazy_enable_if<Pred,Ret>)>
|
||||
{
|
||||
typedef ::boost::lazy_enable_if<Pred,Ret> type;
|
||||
};
|
||||
|
||||
template <bool b, typename Ret>
|
||||
struct unaryfunptr_return_type<void(*)(::boost::lazy_enable_if_c<b,Ret>)>
|
||||
{
|
||||
typedef ::boost::lazy_enable_if_c<b,Ret> type;
|
||||
};
|
||||
|
||||
template <typename Pred, typename Ret>
|
||||
struct unaryfunptr_return_type<void(*)(::boost::disable_if<Pred,Ret>)>
|
||||
{
|
||||
typedef ::boost::disable_if<Pred,Ret> type;
|
||||
};
|
||||
|
||||
template <bool b, typename Ret>
|
||||
struct unaryfunptr_return_type<void(*)(::boost::disable_if_c<b,Ret>)>
|
||||
{
|
||||
typedef ::boost::disable_if_c<b,Ret> type;
|
||||
};
|
||||
|
||||
template <typename B, typename Ret>
|
||||
struct unaryfunptr_return_type<void(*)(::boost::lazy_disable_if<B,Ret>)>
|
||||
{
|
||||
typedef ::boost::lazy_disable_if<B,Ret> type;
|
||||
};
|
||||
|
||||
template <bool b, typename Ret>
|
||||
struct unaryfunptr_return_type<void(*)(::boost::lazy_disable_if_c<b,Ret>)>
|
||||
{
|
||||
typedef ::boost::lazy_disable_if_c<b,Ret> type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS)
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <bool b, typename Ret>
|
||||
struct unaryfunptr_return_type<void(*)(::std::enable_if<b,Ret>)>
|
||||
{
|
||||
typedef ::std::enable_if<b,Ret> type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_NO_CXX11_HDR_TYPE_TRAITS
|
||||
#endif // BOOST_NO_SFINAE
|
||||
|
||||
// A macro that takes a parenthesized C++ type name (T) and transforms it
|
||||
// into an un-parenthesized type expression equivalent to identity<T>.
|
||||
#define BOOST_PARAMETER_PARENTHESIZED_RETURN_TYPE(x) \
|
||||
::boost::parameter::aux::unaryfunptr_return_type< void(*)x >::type
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
// Copyright David Abrahams 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_TYPE_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_PARENTHESIZED_TYPE_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// A metafunction that transforms void(*)(T) -> T
|
||||
template <typename UnaryFunctionPointer>
|
||||
struct unaryfunptr_arg_type;
|
||||
|
||||
template <typename Arg>
|
||||
struct unaryfunptr_arg_type<void(*)(Arg)>
|
||||
{
|
||||
typedef Arg type;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct unaryfunptr_arg_type<void(*)(void)>
|
||||
{
|
||||
typedef void type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
// A macro that takes a parenthesized C++ type name (T) and transforms it
|
||||
// into an un-parenthesized type expression equivalent to T.
|
||||
#define BOOST_PARAMETER_PARENTHESIZED_TYPE(x) \
|
||||
::boost::parameter::aux::unaryfunptr_arg_type< void(*)x >::type
|
||||
|
||||
#endif // include guard
|
||||
|
||||
109
include/boost/parameter/aux_/preprocessor/impl/specification.hpp
Normal file
109
include/boost/parameter/aux_/preprocessor/impl/specification.hpp
Normal file
@@ -0,0 +1,109 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPECIFICATION_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPECIFICATION_HPP
|
||||
|
||||
#include <boost/parameter/optional.hpp>
|
||||
|
||||
// Helper macros for BOOST_PARAMETER_SPECIFICATION_ELEM_R.
|
||||
#define BOOST_PARAMETER_QUALIFIED_TAG_optional(tag) \
|
||||
optional<tag
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/required.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_QUALIFIED_TAG_required(tag) \
|
||||
required<tag
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/deduced.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_QUALIFIED_TAG_deduced_optional(tag) \
|
||||
optional< ::boost::parameter::deduced<tag>
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_QUALIFIED_TAG_deduced_required(tag) \
|
||||
required< ::boost::parameter::deduced<tag>
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
|
||||
#include <boost/parameter/aux_/use_default.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_SPECIFICATION_ELEM_R(r, tag_namespace, i, elem) \
|
||||
BOOST_PP_COMMA_IF(i) ::boost::parameter::BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_QUALIFIED_TAG_ \
|
||||
, BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \
|
||||
)(tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(elem)) \
|
||||
, ::boost::parameter::aux::use_default \
|
||||
>
|
||||
/**/
|
||||
|
||||
#else // !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
|
||||
#include <boost/parameter/aux_/pp_impl/unwrap_predicate.hpp>
|
||||
|
||||
// Expands to each boost::parameter::parameters<> element type.
|
||||
#define BOOST_PARAMETER_SPECIFICATION_ELEM_R(r, tag_namespace, i, elem) \
|
||||
BOOST_PP_COMMA_IF(i) ::boost::parameter::BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_QUALIFIED_TAG_ \
|
||||
, BOOST_PARAMETER_FN_ARG_QUALIFIER(elem) \
|
||||
)(tag_namespace::BOOST_PARAMETER_FN_ARG_NAME(elem)) \
|
||||
, typename ::boost::parameter::aux::unwrap_predicate< \
|
||||
void BOOST_PARAMETER_FN_ARG_PRED(elem) \
|
||||
>::type \
|
||||
>
|
||||
/**/
|
||||
|
||||
#endif // Borland workarounds needed.
|
||||
|
||||
#include <boost/parameter/parameters.hpp>
|
||||
#include <boost/parameter/aux_/preprocessor/impl/function_name.hpp>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/seq/for_each_i.hpp>
|
||||
|
||||
// Expands to a boost::parameter::parameters<> specialization for the
|
||||
// function named base. Used by BOOST_PARAMETER_CONSTRUCTOR_AUX and
|
||||
// BOOST_PARAMETER_FUNCTION_HEAD for their respective ParameterSpec models.
|
||||
#define BOOST_PARAMETER_SPECIFICATION(tag_ns, base, split_args, is_const) \
|
||||
template <typename BoostParameterDummy> \
|
||||
struct BOOST_PP_CAT( \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_IF( \
|
||||
is_const \
|
||||
, boost_param_params_const_ \
|
||||
, boost_param_params_ \
|
||||
) \
|
||||
, __LINE__ \
|
||||
) \
|
||||
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
|
||||
) : ::boost::parameter::parameters< \
|
||||
BOOST_PP_SEQ_FOR_EACH_I( \
|
||||
BOOST_PARAMETER_SPECIFICATION_ELEM_R, tag_ns, split_args \
|
||||
) \
|
||||
> \
|
||||
{ \
|
||||
}; \
|
||||
typedef BOOST_PP_CAT( \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PP_IF( \
|
||||
is_const \
|
||||
, boost_param_params_const_ \
|
||||
, boost_param_params_ \
|
||||
) \
|
||||
, __LINE__ \
|
||||
) \
|
||||
, BOOST_PARAMETER_MEMBER_FUNCTION_NAME(base) \
|
||||
)<int>
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPLIT_ARGS_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IMPL_SPLIT_ARGS_HPP
|
||||
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
// Accessor macros for the split_args tuple.
|
||||
#define BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(x) BOOST_PP_TUPLE_ELEM(4, 0, x)
|
||||
#define BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(x) BOOST_PP_TUPLE_ELEM(4, 1, x)
|
||||
#define BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(x) BOOST_PP_TUPLE_ELEM(4, 2, x)
|
||||
#define BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(x) BOOST_PP_TUPLE_ELEM(4, 3, x)
|
||||
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/seq/push_back.hpp>
|
||||
|
||||
// Helper macros for BOOST_PARAMETER_FUNCTION_SPLIT_ARGS.
|
||||
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(s_a, arg) \
|
||||
( \
|
||||
BOOST_PP_INC(BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(s_a)) \
|
||||
, BOOST_PP_SEQ_PUSH_BACK(BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(s_a), arg) \
|
||||
, BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(s_a) \
|
||||
, BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_a) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_deduced_required(split_args, arg) \
|
||||
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_required(split_args, arg)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(s_a, arg) \
|
||||
( \
|
||||
BOOST_PARAMETER_SPLIT_ARG_REQ_COUNT(s_a) \
|
||||
, BOOST_PARAMETER_SPLIT_ARG_REQ_SEQ(s_a) \
|
||||
, BOOST_PP_INC(BOOST_PARAMETER_SPLIT_ARG_OPT_COUNT(s_a)) \
|
||||
, BOOST_PP_SEQ_PUSH_BACK(BOOST_PARAMETER_SPLIT_ARG_OPT_SEQ(s_a), arg) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG_deduced_optional(split_args, arg) \
|
||||
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_optional(split_args, arg)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/impl/argument_specs.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARG(s, split_args, arg) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_FUNCTION_SPLIT_ARG_ \
|
||||
, BOOST_PARAMETER_FN_ARG_QUALIFIER(arg) \
|
||||
)(split_args, arg)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/seq/fold_left.hpp>
|
||||
#include <boost/preprocessor/seq/seq.hpp>
|
||||
|
||||
// Expands from the flattened BOOST_PARAMETER_FUNCTION et. al. arg sequence to
|
||||
// the tuple (required_count, required_args, optional_count, optional_args).
|
||||
#define BOOST_PARAMETER_FUNCTION_SPLIT_ARGS(args) \
|
||||
BOOST_PP_SEQ_FOLD_LEFT( \
|
||||
BOOST_PARAMETER_FUNCTION_SPLIT_ARG \
|
||||
, (0, BOOST_PP_SEQ_NIL, 0, BOOST_PP_SEQ_NIL) \
|
||||
, args \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
78
include/boost/parameter/aux_/preprocessor/inc_binary_seq.hpp
Normal file
78
include/boost/parameter/aux_/preprocessor/inc_binary_seq.hpp
Normal file
@@ -0,0 +1,78 @@
|
||||
// Copyright Cromwell D. Enage 2013.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_INC_BINARY_SEQ_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_INC_BINARY_SEQ_HPP
|
||||
|
||||
#include <boost/preprocessor/seq/push_back.hpp>
|
||||
|
||||
// This macro keeps the rest of the sequence if carry == 0.
|
||||
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_0(seq, element) \
|
||||
(BOOST_PP_SEQ_PUSH_BACK(seq, element), 0)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/control/iif.hpp>
|
||||
|
||||
// This macro updates the rest of the sequence if carry == 1.
|
||||
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_1(seq, element) \
|
||||
(BOOST_PP_SEQ_PUSH_BACK(seq, BOOST_PP_IIF(element, 0, 1)), element)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
// This macro maintains a tuple (seq, carry), where seq is the intermediate
|
||||
// result and carry is a flag that will unset upon finding an element == 0.
|
||||
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_OP(s, result_tuple, element) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_ \
|
||||
, BOOST_PP_TUPLE_ELEM(2, 1, result_tuple) \
|
||||
)(BOOST_PP_TUPLE_ELEM(2, 0, result_tuple), element)
|
||||
/**/
|
||||
|
||||
// This macro keeps the sequence at its original length if carry == 0.
|
||||
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_0(seq) seq
|
||||
/**/
|
||||
|
||||
// This macro appends a zero to seq if carry == 1.
|
||||
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_1(seq) \
|
||||
BOOST_PP_SEQ_PUSH_BACK(seq, 0)
|
||||
/**/
|
||||
|
||||
// This macro takes in the tuple (seq, carry), with carry indicating whether
|
||||
// or not seq originally contained all 1s. If so, then seq now contains all
|
||||
// 0s, and this macro pushes an extra 0 before expanding to the new sequence.
|
||||
// Otherwise, this macro expands to seq as is.
|
||||
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL(seq_and_carry) \
|
||||
BOOST_PP_CAT( \
|
||||
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL_ \
|
||||
, BOOST_PP_TUPLE_ELEM(2, 1, seq_and_carry) \
|
||||
)(BOOST_PP_TUPLE_ELEM(2, 0, seq_and_carry))
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/seq/seq.hpp>
|
||||
#include <boost/preprocessor/seq/fold_left.hpp>
|
||||
|
||||
// This macro treats the specified sequence of 1s and 0s like a binary number
|
||||
// in reverse and expands to a sequence representing the next value up.
|
||||
// However, if the input sequence contains all 1s, then the output sequence
|
||||
// will contain one more element but all 0s.
|
||||
//
|
||||
// Examples:
|
||||
// seq = (1)(0)(1)(0) --> return (0)(1)(1)(0)
|
||||
// seq = (1)(1)(1)(0) --> return (0)(0)(0)(1)
|
||||
// seq = (1)(1)(1)(1) --> return (0)(0)(0)(0)(0)
|
||||
#define BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ(seq) \
|
||||
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_IMPL( \
|
||||
BOOST_PP_SEQ_FOLD_LEFT( \
|
||||
BOOST_PARAMETER_AUX_PP_INC_BINARY_SEQ_OP \
|
||||
, (BOOST_PP_SEQ_NIL, 1) \
|
||||
, seq \
|
||||
) \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
31
include/boost/parameter/aux_/preprocessor/is_binary.hpp
Normal file
31
include/boost/parameter/aux_/preprocessor/is_binary.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IS_BINARY_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IS_BINARY_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
// From Paul Mensonides
|
||||
#include <boost/preprocessor/punctuation/comma.hpp>
|
||||
#include <boost/preprocessor/detail/split.hpp>
|
||||
#define BOOST_PARAMETER_IS_BINARY(x) \
|
||||
BOOST_PP_SPLIT(1, BOOST_PARAMETER_IS_BINARY_C x BOOST_PP_COMMA() 0)
|
||||
/**/
|
||||
#include <boost/preprocessor/punctuation/paren.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
#define BOOST_PARAMETER_IS_BINARY_C(x,y) \
|
||||
~, 1 BOOST_PP_RPAREN() \
|
||||
BOOST_PP_TUPLE_EAT(2) BOOST_PP_LPAREN() ~
|
||||
/**/
|
||||
#else
|
||||
#include <boost/preprocessor/detail/is_binary.hpp>
|
||||
#define BOOST_PARAMETER_IS_BINARY(x) BOOST_PP_IS_BINARY(x)
|
||||
#endif
|
||||
|
||||
#endif // include guard
|
||||
|
||||
32
include/boost/parameter/aux_/preprocessor/is_nullary.hpp
Normal file
32
include/boost/parameter/aux_/preprocessor/is_nullary.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_IS_NULLARY_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_IS_NULLARY_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
// From Paul Mensonides
|
||||
#include <boost/preprocessor/punctuation/comma.hpp>
|
||||
#include <boost/preprocessor/detail/split.hpp>
|
||||
#define BOOST_PARAMETER_IS_NULLARY(x) \
|
||||
BOOST_PP_SPLIT(1, BOOST_PARAMETER_IS_NULLARY_C x BOOST_PP_COMMA() 0)
|
||||
/**/
|
||||
#include <boost/preprocessor/punctuation/paren.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
#define BOOST_PARAMETER_IS_NULLARY_C() \
|
||||
~, 1 BOOST_PP_RPAREN() \
|
||||
BOOST_PP_TUPLE_EAT(2) BOOST_PP_LPAREN() ~
|
||||
/**/
|
||||
#else
|
||||
#include <boost/preprocessor/detail/is_nullary.hpp>
|
||||
#define BOOST_PARAMETER_IS_NULLARY(x) BOOST_PP_IS_NULLARY(x)
|
||||
/**/
|
||||
#endif
|
||||
|
||||
#endif // include guard
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// No include guard. This file is intended for multiple inclusion.
|
||||
|
||||
#define BOOST_PARAMETER_right_angle(z, n, _) >
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_satisfies_end(z, n, false_t) ,false_t>
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/seq/elem.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
// Generates:
|
||||
//
|
||||
// make<
|
||||
// parameter_spec##0, argument_type##0
|
||||
// , make<
|
||||
// parameter_spec##1, argument_type##1
|
||||
// , ... boost::mpl::identity<boost::parameter::aux::empty_arg_list>
|
||||
// ...>
|
||||
// >
|
||||
#define BOOST_PARAMETER_make_arg_list(z, n, names) \
|
||||
BOOST_PP_SEQ_ELEM(0, names)< \
|
||||
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n), \
|
||||
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(2, names), n),
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_build_arg_list(n, make, param_spec, arg_type) \
|
||||
BOOST_PP_REPEAT( \
|
||||
n, BOOST_PARAMETER_make_arg_list, (make)(param_spec)(arg_type) \
|
||||
) \
|
||||
::boost::mpl::identity< ::boost::parameter::void_> \
|
||||
BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_make_deduced_list(z, n, names) \
|
||||
BOOST_PP_SEQ_ELEM(0, names)<BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n),
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_build_deduced_list(n, make, parameter_spec) \
|
||||
BOOST_PP_REPEAT( \
|
||||
n, BOOST_PARAMETER_make_deduced_list, (make)(parameter_spec) \
|
||||
) \
|
||||
::boost::mpl::identity< ::boost::parameter::void_> \
|
||||
BOOST_PP_REPEAT(n, BOOST_PARAMETER_right_angle, _)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_forward_typedef(z, n, names) \
|
||||
typedef BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(0, names), n) \
|
||||
BOOST_PP_CAT(BOOST_PP_SEQ_ELEM(1, names), n);
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_template_args(z, n, prefix) \
|
||||
typename BOOST_PP_CAT(prefix, n) = ::boost::parameter::void_
|
||||
/**/
|
||||
|
||||
#include <boost/mpl/pair.hpp>
|
||||
|
||||
#if (0 < BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
|
||||
|
||||
#include <boost/parameter/aux_/pack/item.hpp>
|
||||
#include <boost/preprocessor/control/iif.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_make_arg_items_R(r, prefix, i, elem) \
|
||||
::boost::parameter::aux::item<BOOST_PP_CAT(prefix, i), \
|
||||
BOOST_PP_CAT(A, i) BOOST_PP_IIF(elem, &, const&),
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/pack/make_arg_list.hpp>
|
||||
#include <boost/parameter/aux_/pack/tag_keyword_arg.hpp>
|
||||
#include <boost/preprocessor/seq/for_each_i.hpp>
|
||||
#include <boost/preprocessor/seq/size.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_function_call_arg_list_R(r, seq) \
|
||||
::boost::parameter::aux::make_arg_list< \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R( \
|
||||
r, BOOST_PARAMETER_make_arg_items_R, PS, seq \
|
||||
) \
|
||||
::boost::parameter::void_ \
|
||||
BOOST_PP_REPEAT( \
|
||||
BOOST_PP_SEQ_SIZE(seq), BOOST_PARAMETER_right_angle, _ \
|
||||
) \
|
||||
, deduced_list \
|
||||
, ::boost::parameter::aux::tag_keyword_arg \
|
||||
>
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_function_call_arg_pack_init(z, n, limit) \
|
||||
BOOST_PP_CAT(a, BOOST_PP_SUB(limit, n))
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/binary_seq_to_args.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
||||
#include <boost/preprocessor/seq/seq.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_function_call_op_overload_R(r, seq) \
|
||||
template < \
|
||||
BOOST_PP_ENUM_PARAMS( \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \
|
||||
, typename A \
|
||||
) \
|
||||
> \
|
||||
inline typename ::boost::mpl::first< \
|
||||
typename BOOST_PARAMETER_function_call_arg_list_R( \
|
||||
r, BOOST_PP_SEQ_TAIL(seq) \
|
||||
)::type \
|
||||
>::type \
|
||||
operator()( \
|
||||
BOOST_PARAMETER_AUX_PP_BINARY_SEQ_TO_ARGS( \
|
||||
BOOST_PP_SEQ_TAIL(seq), (A)(a) \
|
||||
) \
|
||||
) const \
|
||||
{ \
|
||||
typedef typename BOOST_PARAMETER_function_call_arg_list_R( \
|
||||
r, BOOST_PP_SEQ_TAIL(seq) \
|
||||
)::type result; \
|
||||
typedef typename ::boost::mpl::first<result>::type result_type; \
|
||||
typedef typename ::boost::mpl::second<result>::type error; \
|
||||
error(); \
|
||||
return result_type( \
|
||||
BOOST_PP_ENUM( \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \
|
||||
, BOOST_PARAMETER_function_call_arg_pack_init \
|
||||
, BOOST_PP_DEC(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq))) \
|
||||
) \
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS( \
|
||||
BOOST_PP_SUB( \
|
||||
BOOST_PARAMETER_COMPOSE_MAX_ARITY \
|
||||
, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)) \
|
||||
) \
|
||||
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT \
|
||||
) \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
|
||||
#endif // exponential overloads
|
||||
|
||||
#include <boost/parameter/aux_/pack/satisfies.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_satisfies_begin(z, n, prefix) \
|
||||
::boost::mpl::eval_if< \
|
||||
::boost::parameter::aux::satisfies_requirements_of< \
|
||||
typename ::boost::mpl::first<ArgumentPackAndError>::type \
|
||||
, BOOST_PP_CAT(prefix, n) \
|
||||
>,
|
||||
/**/
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// No include guard. This file is intended for multiple inclusion.
|
||||
|
||||
#undef BOOST_PARAMETER_satisfies_begin
|
||||
#if (0 < BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
|
||||
#undef BOOST_PARAMETER_function_call_op_overload_R
|
||||
#undef BOOST_PARAMETER_function_call_arg_pack_init
|
||||
#undef BOOST_PARAMETER_function_call_arg_list_R
|
||||
#undef BOOST_PARAMETER_make_arg_items_R
|
||||
#endif
|
||||
#undef BOOST_PARAMETER_template_args
|
||||
#undef BOOST_PARAMETER_forward_typedef
|
||||
#undef BOOST_PARAMETER_build_deduced_list
|
||||
#undef BOOST_PARAMETER_make_deduced_list
|
||||
#undef BOOST_PARAMETER_build_arg_list
|
||||
#undef BOOST_PARAMETER_make_arg_list
|
||||
#undef BOOST_PARAMETER_satisfies_end
|
||||
#undef BOOST_PARAMETER_right_angle
|
||||
|
||||
18
include/boost/parameter/aux_/preprocessor/nullptr.hpp
Normal file
18
include/boost/parameter/aux_/preprocessor/nullptr.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright Cromwell D. Enage 2019.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_NULLPTR_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_NULLPTR_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#if defined(BOOST_NO_CXX11_NULLPTR)
|
||||
#define BOOST_PARAMETER_AUX_PP_NULLPTR 0
|
||||
#else
|
||||
#define BOOST_PARAMETER_AUX_PP_NULLPTR nullptr
|
||||
#endif
|
||||
|
||||
#endif // include guard
|
||||
|
||||
92
include/boost/parameter/aux_/preprocessor/overloads.hpp
Normal file
92
include/boost/parameter/aux_/preprocessor/overloads.hpp
Normal file
@@ -0,0 +1,92 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// This file generates overloads in this format:
|
||||
//
|
||||
// template <typename A0, typename A1>
|
||||
// typename ::boost::mpl::apply_wrap1<
|
||||
// ::boost::parameter::aux::make_arg_list<
|
||||
// PS0,A0
|
||||
// , ::boost::parameter::aux::make_arg_list<
|
||||
// PS1,A1
|
||||
// , ::boost::mpl::identity<
|
||||
// ::boost::parameter::aux::empty_arg_list
|
||||
// >
|
||||
// >
|
||||
// >
|
||||
// , unnamed_list
|
||||
// >::type
|
||||
// operator()(A0 const& a0, A1 const& a1) const
|
||||
// {
|
||||
// typedef typename ::boost::mpl::apply_wrap1<
|
||||
// ::boost::parameter::aux::make_arg_list<
|
||||
// PS0,A0
|
||||
// , ::boost::parameter::aux::make_arg_list<
|
||||
// PS1,A1
|
||||
// , ::boost::mpl::identity<
|
||||
// ::boost::parameter::aux::empty_arg_list
|
||||
// >
|
||||
// >
|
||||
// >
|
||||
// >::type arg_tuple;
|
||||
//
|
||||
// return arg_tuple(
|
||||
// a0
|
||||
// , a1
|
||||
// , ::boost::parameter::aux::void_()
|
||||
// ...
|
||||
// );
|
||||
// }
|
||||
//
|
||||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
# error Boost.Parameters - do not include this file!
|
||||
#endif
|
||||
|
||||
#define N BOOST_PP_ITERATION()
|
||||
|
||||
#define BOOST_PARAMETER_open_list(z, n, text) \
|
||||
::boost::parameter::aux::item< \
|
||||
BOOST_PP_CAT(PS, n), BOOST_PP_CAT(A, n)
|
||||
|
||||
#define BOOST_PARAMETER_close_list(z, n, text) >
|
||||
|
||||
#define BOOST_PARAMETER_arg_list(n) \
|
||||
::boost::parameter::aux::make_arg_list< \
|
||||
BOOST_PP_ENUM(N, BOOST_PARAMETER_open_list, _) \
|
||||
, ::boost::parameter::void_ \
|
||||
BOOST_PP_REPEAT(N, BOOST_PARAMETER_close_list, _) \
|
||||
, deduced_list \
|
||||
, ::boost::parameter::aux::tag_keyword_arg \
|
||||
>
|
||||
|
||||
#define BOOST_PARAMETER_arg_pack_init(z, n, limit) \
|
||||
BOOST_PP_CAT(a, BOOST_PP_SUB(limit, n))
|
||||
|
||||
template <BOOST_PP_ENUM_PARAMS(N, typename A)>
|
||||
typename ::boost::mpl::first<
|
||||
typename BOOST_PARAMETER_arg_list(N)::type
|
||||
>::type
|
||||
operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)) const
|
||||
{
|
||||
typedef typename BOOST_PARAMETER_arg_list(N)::type result;
|
||||
typedef typename ::boost::mpl::first<result>::type result_type;
|
||||
typedef typename ::boost::mpl::second<result>::type error;
|
||||
error();
|
||||
|
||||
return result_type(
|
||||
BOOST_PP_ENUM(N, BOOST_PARAMETER_arg_pack_init, BOOST_PP_DEC(N))
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS(
|
||||
BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, N)
|
||||
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#undef BOOST_PARAMETER_arg_list
|
||||
#undef BOOST_PARAMETER_close_list
|
||||
#undef BOOST_PARAMETER_open_list
|
||||
#undef N
|
||||
|
||||
88
include/boost/parameter/aux_/preprocessor/qualifier.hpp
Normal file
88
include/boost/parameter/aux_/preprocessor/qualifier.hpp
Normal file
@@ -0,0 +1,88 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_QUALIFIER_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_QUALIFIER_HPP
|
||||
|
||||
#define BOOST_PARAMETER_QUALIFIER_EAT_in(x)
|
||||
#define BOOST_PARAMETER_QUALIFIER_EAT_out(x)
|
||||
#define BOOST_PARAMETER_QUALIFIER_EAT_in_out(x)
|
||||
#define BOOST_PARAMETER_QUALIFIER_EAT_consume(x)
|
||||
#define BOOST_PARAMETER_QUALIFIER_EAT_move_from(x)
|
||||
#define BOOST_PARAMETER_QUALIFIER_EAT_forward(x)
|
||||
|
||||
#define BOOST_PARAMETER_GET_QUALIFIER_in(x) in_reference
|
||||
#define BOOST_PARAMETER_GET_QUALIFIER_out(x) out_reference
|
||||
#define BOOST_PARAMETER_GET_QUALIFIER_in_out(x) in_out_reference
|
||||
#define BOOST_PARAMETER_GET_QUALIFIER_consume(x) consume_reference
|
||||
#define BOOST_PARAMETER_GET_QUALIFIER_move_from(x) move_from_reference
|
||||
#define BOOST_PARAMETER_GET_QUALIFIER_forward(x) forward_reference
|
||||
|
||||
#define BOOST_PARAMETER_STRIP_QUALIFIER_in(x) x
|
||||
#define BOOST_PARAMETER_STRIP_QUALIFIER_out(x) x
|
||||
#define BOOST_PARAMETER_STRIP_QUALIFIER_in_out(x) x
|
||||
#define BOOST_PARAMETER_STRIP_QUALIFIER_consume(x) x
|
||||
#define BOOST_PARAMETER_STRIP_QUALIFIER_move_from(x) x
|
||||
#define BOOST_PARAMETER_STRIP_QUALIFIER_forward(x) x
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_GET_QUALIFIER_GET(x) \
|
||||
BOOST_PP_CAT(BOOST_PARAMETER_GET_QUALIFIER_, x)
|
||||
/**/
|
||||
|
||||
#define BOOST_PARAMETER_GET_UNQUALIFIED(x) \
|
||||
BOOST_PP_CAT(BOOST_PARAMETER_STRIP_QUALIFIER_, x)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
|
||||
// Expands to 1 if x is either "in(k)", "out(k)", "in_out(k)", "consume(k)",
|
||||
// "move_from(k)", or "forward(k)"; expands to 0 otherwise.
|
||||
#define BOOST_PARAMETER_IS_QUALIFIER(x) \
|
||||
BOOST_PP_IS_EMPTY(BOOST_PP_CAT(BOOST_PARAMETER_QUALIFIER_EAT_, x))
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/control/iif.hpp>
|
||||
|
||||
// Expands to the qualifier of x,
|
||||
// where x is either a keyword qualifier or a keyword.
|
||||
//
|
||||
// k => forward_reference
|
||||
// in(k) => in_reference
|
||||
// out(k) => out_reference
|
||||
// in_out(k) => in_out_reference
|
||||
// forward(k) => forward_reference
|
||||
// consume(k) => consume_reference
|
||||
// move_from(k) => move_from_reference
|
||||
#define BOOST_PARAMETER_GET_QUALIFIER(x) \
|
||||
BOOST_PP_IIF( \
|
||||
BOOST_PARAMETER_IS_QUALIFIER(x) \
|
||||
, BOOST_PARAMETER_GET_QUALIFIER_GET(x) \
|
||||
, forward_reference \
|
||||
)
|
||||
/**/
|
||||
|
||||
// Expands to the unqualified version of x,
|
||||
// where x is either a keyword qualifier or a keyword.
|
||||
//
|
||||
// k => k
|
||||
// in(k) => k
|
||||
// out(k) => k
|
||||
// in_out(k) => k
|
||||
// forward(k) => k
|
||||
// consume(k) => k
|
||||
// move_from(k) => k
|
||||
#define BOOST_PARAMETER_UNQUALIFIED(x) \
|
||||
BOOST_PP_IIF( \
|
||||
BOOST_PARAMETER_IS_QUALIFIER(x) \
|
||||
, BOOST_PARAMETER_GET_UNQUALIFIED(x) \
|
||||
, x \
|
||||
)
|
||||
/**/
|
||||
|
||||
#endif // include guard
|
||||
|
||||
26
include/boost/parameter/aux_/preprocessor/seq_enum.hpp
Normal file
26
include/boost/parameter/aux_/preprocessor/seq_enum.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
// Copyright David Abrahams 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_PREPROCESSOR_SEQ_ENUM_HPP
|
||||
#define BOOST_PARAMETER_AUX_PREPROCESSOR_SEQ_ENUM_HPP
|
||||
|
||||
#include <boost/preprocessor/seq/enum.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__MWERKS__, <= 0x3003)
|
||||
#include <boost/preprocessor/seq/size.hpp>
|
||||
// Temporary version of BOOST_PP_SEQ_ENUM
|
||||
// until Paul M. integrates the workaround.
|
||||
#define BOOST_PARAMETER_SEQ_ENUM_I(size, seq) \
|
||||
BOOST_PP_CAT(BOOST_PP_SEQ_ENUM_, size) seq
|
||||
#define BOOST_PARAMETER_SEQ_ENUM(seq) \
|
||||
BOOST_PARAMETER_SEQ_ENUM_I(BOOST_PP_SEQ_SIZE(seq), seq)
|
||||
#else
|
||||
#define BOOST_PARAMETER_SEQ_ENUM(seq) BOOST_PP_SEQ_ENUM(seq)
|
||||
#endif
|
||||
|
||||
#endif // include guard
|
||||
|
||||
1807
include/boost/parameter/aux_/preprocessor/seq_merge.hpp
Normal file
1807
include/boost/parameter/aux_/preprocessor/seq_merge.hpp
Normal file
File diff suppressed because it is too large
Load Diff
71
include/boost/parameter/aux_/result_of0.hpp
Executable file → Normal file
71
include/boost/parameter/aux_/result_of0.hpp
Executable file → Normal file
@@ -1,36 +1,53 @@
|
||||
// Copyright David Abrahams 2005. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Copyright David Abrahams 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
|
||||
# define BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
|
||||
#define BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
|
||||
|
||||
# include <boost/utility/result_of.hpp>
|
||||
|
||||
// A metafunction returning the result of invoking a nullary function
|
||||
// object of the given type.
|
||||
|
||||
#ifndef BOOST_NO_RESULT_OF
|
||||
|
||||
# include <boost/utility/result_of.hpp>
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
template <class F>
|
||||
struct result_of0 : result_of<F()>
|
||||
{};
|
||||
|
||||
}}} // namespace boost::parameter::aux_
|
||||
#include <boost/parameter/aux_/use_default_tag.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
#include <boost/utility/result_of.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_void.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
template <class F>
|
||||
struct result_of0
|
||||
{
|
||||
typedef typename F::result_type type;
|
||||
};
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
}}} // namespace boost::parameter::aux_
|
||||
// A metafunction returning the result of invoking
|
||||
// a nullary function object of the given type.
|
||||
template <typename F>
|
||||
class result_of0
|
||||
{
|
||||
#if defined(BOOST_NO_RESULT_OF)
|
||||
typedef typename F::result_type result_of_F;
|
||||
#else
|
||||
typedef typename ::boost::result_of<F()>::type result_of_F;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
public:
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = ::boost::mp11::mp_if<
|
||||
::std::is_void<result_of_F>
|
||||
#else
|
||||
typedef typename ::boost::mpl::if_<
|
||||
::boost::is_void<result_of_F>
|
||||
#endif
|
||||
, ::boost::parameter::aux::use_default_tag
|
||||
, result_of_F
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
>;
|
||||
#else
|
||||
>::type type;
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
#endif // BOOST_PARAMETER_AUX_RESULT_OF0_DWA2005511_HPP
|
||||
|
||||
118
include/boost/parameter/aux_/set.hpp
Normal file
118
include/boost/parameter/aux_/set.hpp
Normal file
@@ -0,0 +1,118 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_SET_060912_HPP
|
||||
#define BOOST_PARAMETER_SET_060912_HPP
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/list.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
typedef ::boost::mp11::mp_list<> set0;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mp11/algorithm.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename S, typename K>
|
||||
struct insert_
|
||||
{
|
||||
using type = ::boost::mp11::mp_insert_c<S,0,K>;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Set, typename K>
|
||||
struct has_key_
|
||||
{
|
||||
using type = ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_empty<Set>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::std::is_same<
|
||||
::boost::mp11::mp_find<Set,K>
|
||||
, ::boost::mp11::mp_size<Set>
|
||||
>
|
||||
>;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
#include <boost/mpl/list.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
typedef ::boost::mpl::list0<> set0;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/push_front.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Set, typename K>
|
||||
struct insert_ : ::boost::mpl::push_front<Set,K>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/end.hpp>
|
||||
#include <boost/mpl/find.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Set, typename K>
|
||||
struct has_key_
|
||||
{
|
||||
typedef typename ::boost::mpl::find<Set,K>::type iter;
|
||||
typedef typename ::boost::mpl::if_<
|
||||
::boost::is_same<iter,typename ::boost::mpl::end<Set>::type>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>::type type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#else // !BOOST_PARAMETER_CAN_USE_MP11 && Borland workarounds not needed
|
||||
#include <boost/mpl/set/set0.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
typedef ::boost::mpl::set0<> set0;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/insert.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Set, typename K>
|
||||
struct insert_ : ::boost::mpl::insert<Set,K>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/has_key.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Set, typename K>
|
||||
struct has_key_ : ::boost::mpl::has_key<Set,K>
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11 || Borland workarounds needed
|
||||
#endif // include guard
|
||||
|
||||
182
include/boost/parameter/aux_/tag.hpp
Executable file → Normal file
182
include/boost/parameter/aux_/tag.hpp
Executable file → Normal file
@@ -1,38 +1,160 @@
|
||||
// Copyright David Abrahams 2005. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#ifndef BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
|
||||
# define BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
|
||||
// Copyright David Abrahams 2005.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
# include <boost/parameter/aux_/unwrap_cv_reference.hpp>
|
||||
# include <boost/parameter/aux_/tagged_argument.hpp>
|
||||
#ifndef BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
|
||||
#define BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
|
||||
|
||||
#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
|
||||
#include <boost/parameter/aux_/tagged_argument.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11) && \
|
||||
!BOOST_WORKAROUND(BOOST_MSVC, >= 1910)
|
||||
// MSVC-14.1+ assigns rvalue references to tagged_argument instances
|
||||
// instead of tagged_argument_rref instances with this code.
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <class Keyword, class ActualArg
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
, class = typename is_cv_reference_wrapper<ActualArg>::type
|
||||
#endif
|
||||
>
|
||||
struct tag
|
||||
{
|
||||
typedef tagged_argument<
|
||||
Keyword
|
||||
, typename unwrap_cv_reference<ActualArg>::type
|
||||
> type;
|
||||
};
|
||||
template <typename Keyword, typename Arg>
|
||||
struct tag_if_lvalue_reference
|
||||
{
|
||||
using type = ::boost::parameter::aux::tagged_argument_list_of_1<
|
||||
::boost::parameter::aux::tagged_argument<
|
||||
Keyword
|
||||
, typename ::boost::parameter::aux
|
||||
::unwrap_cv_reference<Arg>::type
|
||||
>
|
||||
>;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
template <class Keyword, class ActualArg>
|
||||
struct tag<Keyword,ActualArg,mpl::false_>
|
||||
{
|
||||
typedef tagged_argument<
|
||||
Keyword
|
||||
, ActualArg
|
||||
> type;
|
||||
};
|
||||
#endif
|
||||
template <typename Keyword, typename Arg>
|
||||
struct tag_if_scalar
|
||||
{
|
||||
using type = ::boost::parameter::aux::tagged_argument_list_of_1<
|
||||
::boost::parameter::aux
|
||||
::tagged_argument<Keyword,typename ::std::add_const<Arg>::type>
|
||||
>;
|
||||
};
|
||||
|
||||
template <typename Keyword, typename Arg>
|
||||
using tag_if_otherwise = ::boost::mp11::mp_if<
|
||||
::std::is_scalar<typename ::std::remove_const<Arg>::type>
|
||||
, ::boost::parameter::aux::tag_if_scalar<Keyword,Arg>
|
||||
, ::boost::mp11::mp_identity<
|
||||
::boost::parameter::aux::tagged_argument_list_of_1<
|
||||
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
|
||||
>
|
||||
>
|
||||
>;
|
||||
|
||||
template <typename Keyword, typename Arg>
|
||||
using tag = ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_lvalue_reference<Arg>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::boost::parameter::aux::is_cv_reference_wrapper<Arg>
|
||||
>
|
||||
, ::boost::parameter::aux::tag_if_lvalue_reference<Keyword,Arg>
|
||||
, ::boost::parameter::aux::tag_if_otherwise<Keyword,Arg>
|
||||
>;
|
||||
}}} // namespace boost::parameter::aux_
|
||||
|
||||
#endif // BOOST_PARAMETER_AUX_TAG_DWA2005610_HPP
|
||||
#elif defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/type_traits/add_const.hpp>
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/is_lvalue_reference.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Keyword, typename ActualArg>
|
||||
struct tag
|
||||
{
|
||||
typedef typename ::boost::parameter::aux
|
||||
::unwrap_cv_reference<ActualArg>::type Arg;
|
||||
typedef typename ::boost::add_const<Arg>::type ConstArg;
|
||||
typedef typename ::boost::remove_const<Arg>::type MutArg;
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::is_lvalue_reference<ActualArg>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::parameter::aux::is_cv_reference_wrapper<ActualArg>
|
||||
>::type
|
||||
, ::boost::mpl::identity<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::parameter::aux::tagged_argument_list_of_1<
|
||||
#endif
|
||||
::boost::parameter::aux::tagged_argument<Keyword,Arg>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
>
|
||||
#endif
|
||||
>
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_scalar<MutArg>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
, ::boost::parameter::aux::tagged_argument_list_of_1<
|
||||
::boost::parameter::aux::tagged_argument<Keyword,ConstArg>
|
||||
>
|
||||
, ::boost::parameter::aux::tagged_argument_list_of_1<
|
||||
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
|
||||
>
|
||||
#else
|
||||
, ::boost::parameter::aux::tagged_argument<Keyword,ConstArg>
|
||||
, ::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
|
||||
#endif
|
||||
>
|
||||
>::type type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux_
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <
|
||||
typename Keyword
|
||||
, typename Arg
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
, typename = typename ::boost::parameter::aux
|
||||
::is_cv_reference_wrapper<Arg>::type
|
||||
#endif
|
||||
>
|
||||
struct tag
|
||||
{
|
||||
typedef ::boost::parameter::aux::tagged_argument<
|
||||
Keyword
|
||||
, typename ::boost::parameter::aux::unwrap_cv_reference<Arg>::type
|
||||
> type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux_
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Keyword, typename Arg>
|
||||
struct tag<Keyword,Arg,::boost::mpl::false_>
|
||||
{
|
||||
typedef ::boost::parameter::aux::tagged_argument<
|
||||
Keyword
|
||||
, typename ::boost::remove_reference<Arg>::type
|
||||
> type;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux_
|
||||
|
||||
#endif // Borland workarounds needed.
|
||||
#endif // MP11 or perfect forwarding support
|
||||
#endif // include guard
|
||||
|
||||
|
||||
938
include/boost/parameter/aux_/tagged_argument.hpp
Executable file → Normal file
938
include/boost/parameter/aux_/tagged_argument.hpp
Executable file → Normal file
@@ -1,60 +1,894 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef TAGGED_ARGUMENT_050328_HPP
|
||||
#define TAGGED_ARGUMENT_050328_HPP
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/parameter/aux_/arg_list.hpp>
|
||||
#include <boost/detail/is_xxx.hpp>
|
||||
#ifndef BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP
|
||||
#define BOOST_PARAMETER_TAGGED_ARGUMENT_050328_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Holds a reference to an argument of type Arg associated with
|
||||
// keyword Keyword
|
||||
|
||||
template <class Keyword, class Arg>
|
||||
struct tagged_argument
|
||||
{
|
||||
typedef Keyword key_type;
|
||||
typedef Arg value_type;
|
||||
typedef Arg& reference;
|
||||
|
||||
tagged_argument(reference x) : value(x) {}
|
||||
|
||||
// Comma operator to compose argument list without using parameters<>.
|
||||
// Useful for argument lists with undetermined length.
|
||||
template <class Keyword2, class Arg2>
|
||||
arg_list<
|
||||
tagged_argument<Keyword, Arg>
|
||||
, arg_list<tagged_argument<Keyword2, Arg2> >
|
||||
>
|
||||
operator,(tagged_argument<Keyword2, Arg2> x) const
|
||||
{
|
||||
return arg_list<
|
||||
tagged_argument<Keyword, Arg>
|
||||
, arg_list<tagged_argument<Keyword2, Arg2> >
|
||||
>(
|
||||
*this
|
||||
, arg_list<tagged_argument<Keyword2, Arg2> >(x, empty_arg_list())
|
||||
);
|
||||
}
|
||||
|
||||
reference value;
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
|
||||
// warning suppression
|
||||
private:
|
||||
void operator=(tagged_argument const&);
|
||||
#endif
|
||||
};
|
||||
|
||||
// Defines a metafunction, is_tagged_argument, that identifies
|
||||
// tagged_argument specializations.
|
||||
BOOST_DETAIL_IS_XXX_DEF(tagged_argument,tagged_argument,2)
|
||||
|
||||
struct error_const_lvalue_bound_to_out_parameter;
|
||||
struct error_lvalue_bound_to_consume_parameter;
|
||||
struct error_rvalue_bound_to_out_parameter;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // TAGGED_ARGUMENT_050328_HPP
|
||||
#include <boost/parameter/keyword_fwd.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Keyword, typename Arg>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using tagged_argument_type = ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_scalar<Arg>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::std::is_same<
|
||||
typename Keyword::qualifier
|
||||
, ::boost::parameter::consume_reference
|
||||
>
|
||||
>
|
||||
, ::boost::parameter::aux::error_lvalue_bound_to_consume_parameter
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_const<Arg>
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Keyword::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::parameter::aux
|
||||
::error_const_lvalue_bound_to_out_parameter
|
||||
, ::std::remove_const<Arg>
|
||||
>
|
||||
, ::boost::mp11::mp_identity<Arg>
|
||||
>
|
||||
>;
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
struct tagged_argument_type
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Keyword::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::parameter::aux::error_const_lvalue_bound_to_out_parameter
|
||||
, ::boost::remove_const<Arg>
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/aux_/tagged_argument_fwd.hpp>
|
||||
#include <boost/parameter/aux_/is_tagged_argument.hpp>
|
||||
#include <boost/parameter/aux_/default.hpp>
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/parameter/aux_/arg_list.hpp>
|
||||
#include <boost/parameter/aux_/result_of0.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/apply_wrap.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
||||
#include <boost/function.hpp>
|
||||
#else
|
||||
#include <functional>
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <utility>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Holds an lvalue reference to an argument of type Arg associated with
|
||||
// keyword Keyword
|
||||
template <typename Keyword, typename Arg>
|
||||
class tagged_argument
|
||||
: public ::boost::parameter::aux::tagged_argument_base
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using arg_type = typename ::boost::parameter::aux
|
||||
::tagged_argument_type<Keyword,Arg>::type;
|
||||
#else
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
typename ::boost::mpl::eval_if<
|
||||
::boost::is_scalar<Arg>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::is_same<
|
||||
typename Keyword::qualifier
|
||||
, ::boost::parameter::consume_reference
|
||||
>
|
||||
>::type
|
||||
, ::boost::parameter::aux::error_lvalue_bound_to_consume_parameter
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_const<Arg>
|
||||
, ::boost::parameter::aux::tagged_argument_type<Keyword,Arg>
|
||||
, ::boost::mpl::identity<Arg>
|
||||
>
|
||||
>::type arg_type;
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
public:
|
||||
typedef Keyword key_type;
|
||||
|
||||
// Wrap plain (non-UDT) function objects in either
|
||||
// a boost::function or a std::function. -- Cromwell D. Enage
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using value_type = ::boost::mp11::mp_if<
|
||||
::std::is_function<arg_type>
|
||||
, ::std::function<arg_type>
|
||||
, Arg
|
||||
>;
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typedef typename ::boost::mpl::if_<
|
||||
::boost::is_function<arg_type>
|
||||
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
||||
, ::boost::function<arg_type>
|
||||
#else
|
||||
, ::std::function<arg_type>
|
||||
#endif
|
||||
, Arg
|
||||
>::type value_type;
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
// If Arg is void_, then this type will evaluate to void_&. If the
|
||||
// supplied argument is a plain function, then this type will evaluate
|
||||
// to a reference-to-const function wrapper type. If the supplied
|
||||
// argument is an lvalue, then Arg will be deduced to the lvalue
|
||||
// reference. -- Cromwell D. Enage
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using reference = ::boost::mp11::mp_if<
|
||||
::std::is_function<arg_type>
|
||||
, value_type const&
|
||||
, Arg&
|
||||
>;
|
||||
#else
|
||||
typedef typename ::boost::mpl::if_<
|
||||
::boost::is_function<arg_type>
|
||||
, value_type const&
|
||||
, Arg&
|
||||
>::type reference;
|
||||
#endif
|
||||
|
||||
private:
|
||||
// Store plain functions by value, everything else by reference.
|
||||
// -- Cromwell D. Enage
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_function<arg_type>
|
||||
, value_type
|
||||
, reference
|
||||
> value;
|
||||
#else
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::is_function<arg_type>
|
||||
, value_type
|
||||
, reference
|
||||
>::type value;
|
||||
#endif
|
||||
|
||||
public:
|
||||
inline explicit BOOST_CONSTEXPR tagged_argument(reference x)
|
||||
: value(x)
|
||||
{
|
||||
}
|
||||
|
||||
inline BOOST_CONSTEXPR tagged_argument(tagged_argument const& copy)
|
||||
: value(copy.value)
|
||||
{
|
||||
}
|
||||
|
||||
// A metafunction class that, given a keyword and a default type,
|
||||
// returns the appropriate result type for a keyword lookup given
|
||||
// that default.
|
||||
struct binding
|
||||
{
|
||||
template <typename KW, typename Default, typename Reference>
|
||||
struct apply
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::is_same<KW,key_type>
|
||||
, ::boost::mpl::if_<Reference,reference,value_type>
|
||||
, ::boost::mpl::identity<Default>
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename KW, typename Default, typename Reference>
|
||||
using fn = ::boost::mp11::mp_if<
|
||||
::std::is_same<KW,key_type>
|
||||
, ::boost::mp11::mp_if<Reference,reference,value_type>
|
||||
, Default
|
||||
>;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
// Comma operator to compose argument list without using parameters<>.
|
||||
// Useful for argument lists with undetermined length.
|
||||
template <typename Keyword2, typename Arg2>
|
||||
inline BOOST_CONSTEXPR ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword,Arg>
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
|
||||
>
|
||||
>
|
||||
operator,(
|
||||
::boost::parameter::aux
|
||||
::tagged_argument<Keyword2,Arg2> const& x
|
||||
) const
|
||||
{
|
||||
return ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword,Arg>
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
|
||||
>
|
||||
>(
|
||||
*this
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
|
||||
>(x, ::boost::parameter::aux::empty_arg_list())
|
||||
);
|
||||
}
|
||||
|
||||
template <typename Keyword2, typename Arg2>
|
||||
inline BOOST_CONSTEXPR ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword,Arg>
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument_rref<Keyword2,Arg2>
|
||||
>
|
||||
>
|
||||
operator,(
|
||||
::boost::parameter::aux
|
||||
::tagged_argument_rref<Keyword2,Arg2> const& x
|
||||
) const
|
||||
{
|
||||
return ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword,Arg>
|
||||
, boost::parameter::aux::arg_list<
|
||||
boost::parameter::aux::tagged_argument_rref<Keyword2,Arg2>
|
||||
>
|
||||
>(
|
||||
*this
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux
|
||||
::tagged_argument_rref<Keyword2,Arg2>
|
||||
>(x, ::boost::parameter::aux::empty_arg_list())
|
||||
);
|
||||
}
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
// Accessor interface.
|
||||
inline BOOST_CONSTEXPR reference get_value() const
|
||||
{
|
||||
return this->value;
|
||||
}
|
||||
|
||||
inline BOOST_CONSTEXPR reference
|
||||
operator[](::boost::parameter::keyword<Keyword> const&) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR reference
|
||||
operator[](
|
||||
::boost::parameter::aux::default_<key_type,Default> const&
|
||||
) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
inline BOOST_CONSTEXPR reference
|
||||
operator[](
|
||||
::boost::parameter::aux::lazy_default<key_type,F> const&
|
||||
) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename KW, typename Default>
|
||||
inline BOOST_CONSTEXPR Default&
|
||||
operator[](
|
||||
::boost::parameter::aux::default_<KW,Default> const& x
|
||||
) const
|
||||
{
|
||||
return x.value;
|
||||
}
|
||||
|
||||
template <typename KW, typename Default>
|
||||
inline BOOST_CONSTEXPR Default&&
|
||||
operator[](
|
||||
::boost::parameter::aux::default_r_<KW,Default> const& x
|
||||
) const
|
||||
{
|
||||
return ::std::forward<Default>(x.value);
|
||||
}
|
||||
|
||||
template <typename KW, typename F>
|
||||
inline BOOST_CONSTEXPR
|
||||
typename ::boost::parameter::aux::result_of0<F>::type
|
||||
operator[](
|
||||
::boost::parameter::aux::lazy_default<KW,F> const& x
|
||||
) const
|
||||
{
|
||||
return x.compute_default();
|
||||
}
|
||||
|
||||
template <typename ParameterRequirements>
|
||||
static BOOST_CONSTEXPR typename ParameterRequirements::has_default
|
||||
satisfies(ParameterRequirements*);
|
||||
|
||||
template <typename HasDefault, typename Predicate>
|
||||
static BOOST_CONSTEXPR
|
||||
typename ::boost::mpl::apply_wrap1<Predicate,value_type>::type
|
||||
satisfies(
|
||||
::boost::parameter::aux::parameter_requirements<
|
||||
key_type
|
||||
, Predicate
|
||||
, HasDefault
|
||||
>*
|
||||
);
|
||||
|
||||
// MPL sequence support
|
||||
// Convenience for users
|
||||
typedef ::boost::parameter::aux::tagged_argument<Keyword,Arg> type;
|
||||
// For the benefit of iterators
|
||||
typedef ::boost::parameter::aux::empty_arg_list tail_type;
|
||||
// For dispatching to sequence intrinsics
|
||||
typedef ::boost::parameter::aux::arg_list_tag tag;
|
||||
};
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename Keyword>
|
||||
using tagged_argument_rref_key = ::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Keyword::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::parameter::aux::error_rvalue_bound_to_out_parameter
|
||||
, ::boost::mp11::mp_identity<Keyword>
|
||||
>;
|
||||
#endif
|
||||
|
||||
// Holds an rvalue reference to an argument of type Arg associated with
|
||||
// keyword Keyword
|
||||
template <typename Keyword, typename Arg>
|
||||
struct tagged_argument_rref
|
||||
: ::boost::parameter::aux::tagged_argument_base
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using key_type = typename ::boost::parameter::aux
|
||||
::tagged_argument_rref_key<Keyword>::type;
|
||||
#else
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Keyword::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::parameter::aux::error_rvalue_bound_to_out_parameter
|
||||
, ::boost::mpl::identity<Keyword>
|
||||
>::type key_type;
|
||||
#endif
|
||||
typedef Arg value_type;
|
||||
typedef Arg&& reference;
|
||||
|
||||
private:
|
||||
reference value;
|
||||
|
||||
public:
|
||||
inline explicit BOOST_CONSTEXPR tagged_argument_rref(reference x)
|
||||
: value(::std::forward<Arg>(x))
|
||||
{
|
||||
}
|
||||
|
||||
inline BOOST_CONSTEXPR tagged_argument_rref(
|
||||
tagged_argument_rref const& copy
|
||||
) : value(::std::forward<Arg>(copy.value))
|
||||
{
|
||||
}
|
||||
|
||||
// A metafunction class that, given a keyword and a default type,
|
||||
// returns the appropriate result type for a keyword lookup given
|
||||
// that default.
|
||||
struct binding
|
||||
{
|
||||
template <typename KW, typename Default, typename Reference>
|
||||
struct apply
|
||||
{
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
::boost::is_same<KW,key_type>
|
||||
, ::boost::mpl::if_<Reference,reference,value_type>
|
||||
, ::boost::mpl::identity<Default>
|
||||
>::type type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename KW, typename Default, typename Reference>
|
||||
using fn = ::boost::mp11::mp_if<
|
||||
::std::is_same<KW,key_type>
|
||||
, ::boost::mp11::mp_if<Reference,reference,value_type>
|
||||
, Default
|
||||
>;
|
||||
#endif
|
||||
};
|
||||
|
||||
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
// Comma operator to compose argument list without using parameters<>.
|
||||
// Useful for argument lists with undetermined length.
|
||||
template <typename Keyword2, typename Arg2>
|
||||
inline BOOST_CONSTEXPR ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
|
||||
>
|
||||
>
|
||||
operator,(
|
||||
::boost::parameter::aux
|
||||
::tagged_argument<Keyword2,Arg2> const& x
|
||||
) const
|
||||
{
|
||||
return boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
|
||||
>
|
||||
>(
|
||||
*this
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
|
||||
>(x, ::boost::parameter::aux::empty_arg_list())
|
||||
);
|
||||
}
|
||||
|
||||
template <typename Keyword2, typename Arg2>
|
||||
inline BOOST_CONSTEXPR ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument_rref<Keyword2,Arg2>
|
||||
>
|
||||
>
|
||||
operator,(
|
||||
::boost::parameter::aux
|
||||
::tagged_argument_rref<Keyword2,Arg2> const& x
|
||||
) const
|
||||
{
|
||||
return ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument_rref<Keyword,Arg>
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux
|
||||
::tagged_argument_rref<Keyword2,Arg2>
|
||||
>
|
||||
>(
|
||||
*this
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument_rref<
|
||||
Keyword2
|
||||
, Arg2
|
||||
>
|
||||
>(x, ::boost::parameter::aux::empty_arg_list())
|
||||
);
|
||||
}
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
// Accessor interface.
|
||||
inline BOOST_CONSTEXPR reference get_value() const
|
||||
{
|
||||
return ::std::forward<Arg>(this->value);
|
||||
}
|
||||
|
||||
inline BOOST_CONSTEXPR reference
|
||||
operator[](::boost::parameter::keyword<Keyword> const&) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR reference
|
||||
operator[](
|
||||
::boost::parameter::aux::default_<key_type,Default> const&
|
||||
) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR reference
|
||||
operator[](
|
||||
::boost::parameter::aux::default_r_<key_type,Default> const&
|
||||
) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
inline BOOST_CONSTEXPR reference
|
||||
operator[](
|
||||
::boost::parameter::aux::lazy_default<key_type,F> const&
|
||||
) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename KW, typename Default>
|
||||
inline BOOST_CONSTEXPR Default&
|
||||
operator[](
|
||||
::boost::parameter::aux::default_<KW,Default> const& x
|
||||
) const
|
||||
{
|
||||
return x.value;
|
||||
}
|
||||
|
||||
template <typename KW, typename Default>
|
||||
inline BOOST_CONSTEXPR Default&&
|
||||
operator[](
|
||||
::boost::parameter::aux::default_r_<KW,Default> const& x
|
||||
) const
|
||||
{
|
||||
return ::std::forward<Default>(x.value);
|
||||
}
|
||||
|
||||
template <typename KW, typename F>
|
||||
inline BOOST_CONSTEXPR
|
||||
typename ::boost::parameter::aux::result_of0<F>::type
|
||||
operator[](
|
||||
::boost::parameter::aux::lazy_default<KW,F> const& x
|
||||
) const
|
||||
{
|
||||
return x.compute_default();
|
||||
}
|
||||
|
||||
template <typename ParameterRequirements>
|
||||
static BOOST_CONSTEXPR typename ParameterRequirements::has_default
|
||||
satisfies(ParameterRequirements*);
|
||||
|
||||
template <typename HasDefault, typename Predicate>
|
||||
static BOOST_CONSTEXPR
|
||||
typename ::boost::mpl::apply_wrap1<Predicate,value_type>::type
|
||||
satisfies(
|
||||
::boost::parameter::aux::parameter_requirements<
|
||||
key_type
|
||||
, Predicate
|
||||
, HasDefault
|
||||
>*
|
||||
);
|
||||
|
||||
// MPL sequence support
|
||||
// Convenience for users
|
||||
typedef ::boost::parameter::aux
|
||||
::tagged_argument_rref<Keyword,Arg> type;
|
||||
// For the benefit of iterators
|
||||
typedef ::boost::parameter::aux::empty_arg_list tail_type;
|
||||
// For dispatching to sequence intrinsics
|
||||
typedef ::boost::parameter::aux::arg_list_tag tag;
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Holds an lvalue reference to an argument of type Arg associated with
|
||||
// keyword Keyword
|
||||
template <typename Keyword, typename Arg>
|
||||
class tagged_argument
|
||||
: public ::boost::parameter::aux::tagged_argument_base
|
||||
{
|
||||
typedef typename ::boost::remove_const<Arg>::type arg_type;
|
||||
|
||||
public:
|
||||
typedef Keyword key_type;
|
||||
|
||||
// Wrap plain (non-UDT) function objects in either
|
||||
// a boost::function or a std::function. -- Cromwell D. Enage
|
||||
typedef typename ::boost::mpl::if_<
|
||||
::boost::is_function<arg_type>
|
||||
#if defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
||||
, ::boost::function<arg_type>
|
||||
#else
|
||||
, ::std::function<arg_type>
|
||||
#endif
|
||||
, Arg
|
||||
>::type value_type;
|
||||
|
||||
// If Arg is void_, then this type will evaluate to void_&. If the
|
||||
// supplied argument is a plain function, then this type will evaluate
|
||||
// to a reference-to-const function wrapper type. If the supplied
|
||||
// argument is an lvalue, then Arg will be deduced to the lvalue
|
||||
// reference. -- Cromwell D. Enage
|
||||
typedef typename ::boost::mpl::if_<
|
||||
::boost::is_function<arg_type>
|
||||
, value_type const&
|
||||
, Arg&
|
||||
>::type reference;
|
||||
|
||||
private:
|
||||
// Store plain functions by value, everything else by reference.
|
||||
// -- Cromwell D. Enage
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::is_function<arg_type>
|
||||
, value_type
|
||||
, reference
|
||||
>::type value;
|
||||
|
||||
public:
|
||||
inline explicit BOOST_CONSTEXPR tagged_argument(reference x)
|
||||
: value(x)
|
||||
{
|
||||
}
|
||||
|
||||
inline BOOST_CONSTEXPR tagged_argument(tagged_argument const& copy)
|
||||
: value(copy.value)
|
||||
{
|
||||
}
|
||||
|
||||
// A metafunction class that, given a keyword and a default type,
|
||||
// returns the appropriate result type for a keyword lookup given
|
||||
// that default.
|
||||
struct binding
|
||||
{
|
||||
template <typename KW, typename Default, typename Reference>
|
||||
struct apply
|
||||
{
|
||||
typedef typename ::boost::mpl::eval_if<
|
||||
::boost::is_same<KW,key_type>
|
||||
, ::boost::mpl::if_<Reference,reference,value_type>
|
||||
, ::boost::mpl::identity<Default>
|
||||
>::type type;
|
||||
};
|
||||
};
|
||||
|
||||
// Comma operator to compose argument list without using parameters<>.
|
||||
// Useful for argument lists with undetermined length.
|
||||
template <typename Keyword2, typename Arg2>
|
||||
inline ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword,Arg>
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
|
||||
>
|
||||
>
|
||||
operator,(
|
||||
::boost::parameter::aux
|
||||
::tagged_argument<Keyword2,Arg2> const& x
|
||||
) const
|
||||
{
|
||||
return ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword,Arg>
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
|
||||
>
|
||||
>(
|
||||
*this
|
||||
, ::boost::parameter::aux::arg_list<
|
||||
::boost::parameter::aux::tagged_argument<Keyword2,Arg2>
|
||||
>(x, ::boost::parameter::aux::empty_arg_list())
|
||||
);
|
||||
}
|
||||
|
||||
// Accessor interface.
|
||||
inline BOOST_CONSTEXPR reference get_value() const
|
||||
{
|
||||
return this->value;
|
||||
}
|
||||
|
||||
inline BOOST_CONSTEXPR reference
|
||||
operator[](::boost::parameter::keyword<Keyword> const&) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) || \
|
||||
BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
template <typename KW, typename Default>
|
||||
inline BOOST_CONSTEXPR Default&
|
||||
get_with_default(
|
||||
::boost::parameter::aux::default_<KW,Default> const& x
|
||||
, int
|
||||
) const
|
||||
{
|
||||
return x.value;
|
||||
}
|
||||
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR reference
|
||||
get_with_default(
|
||||
::boost::parameter::aux::default_<key_type,Default> const&
|
||||
, long
|
||||
) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename KW, typename Default>
|
||||
inline BOOST_CONSTEXPR typename ::boost::mpl::apply_wrap3<
|
||||
binding
|
||||
, KW
|
||||
, Default&
|
||||
, ::boost::mpl::true_
|
||||
>::type
|
||||
operator[](
|
||||
::boost::parameter::aux::default_<KW,Default> const& x
|
||||
) const
|
||||
{
|
||||
return this->get_with_default(x, 0L);
|
||||
}
|
||||
|
||||
template <typename KW, typename F>
|
||||
inline BOOST_CONSTEXPR
|
||||
typename ::boost::parameter::aux::result_of0<F>::type
|
||||
get_with_lazy_default(
|
||||
::boost::parameter::aux::lazy_default<KW,F> const& x
|
||||
, int
|
||||
) const
|
||||
{
|
||||
return x.compute_default();
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
inline BOOST_CONSTEXPR reference
|
||||
get_with_lazy_default(
|
||||
::boost::parameter::aux::lazy_default<key_type,F> const&
|
||||
, long
|
||||
) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename KW, typename F>
|
||||
inline BOOST_CONSTEXPR typename ::boost::mpl::apply_wrap3<
|
||||
binding
|
||||
, KW
|
||||
, typename ::boost::parameter::aux::result_of0<F>::type
|
||||
, ::boost::mpl::true_
|
||||
>::type
|
||||
operator[](
|
||||
::boost::parameter::aux::lazy_default<KW,F> const& x
|
||||
) const
|
||||
{
|
||||
return this->get_with_lazy_default(x, 0L);
|
||||
}
|
||||
#else // No function template ordering or Borland workarounds needed.
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR reference
|
||||
operator[](
|
||||
::boost::parameter::aux::default_<key_type,Default> const&
|
||||
) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename F>
|
||||
inline BOOST_CONSTEXPR reference
|
||||
operator[](
|
||||
::boost::parameter::aux::lazy_default<key_type,F> const&
|
||||
) const
|
||||
{
|
||||
return this->get_value();
|
||||
}
|
||||
|
||||
template <typename KW, typename Default>
|
||||
inline BOOST_CONSTEXPR Default&
|
||||
operator[](
|
||||
::boost::parameter::aux::default_<KW,Default> const& x
|
||||
) const
|
||||
{
|
||||
return x.value;
|
||||
}
|
||||
|
||||
template <typename KW, typename F>
|
||||
inline BOOST_CONSTEXPR
|
||||
typename ::boost::parameter::aux::result_of0<F>::type
|
||||
operator[](
|
||||
::boost::parameter::aux::lazy_default<KW,F> const& x
|
||||
) const
|
||||
{
|
||||
return x.compute_default();
|
||||
}
|
||||
|
||||
template <typename ParameterRequirements>
|
||||
static BOOST_CONSTEXPR typename ParameterRequirements::has_default
|
||||
satisfies(ParameterRequirements*);
|
||||
|
||||
template <typename HasDefault, typename Predicate>
|
||||
static BOOST_CONSTEXPR
|
||||
typename ::boost::mpl::apply_wrap1<Predicate,value_type>::type
|
||||
satisfies(
|
||||
::boost::parameter::aux::parameter_requirements<
|
||||
key_type
|
||||
, Predicate
|
||||
, HasDefault
|
||||
>*
|
||||
);
|
||||
#endif // Function template ordering, Borland workarounds needed.
|
||||
|
||||
// MPL sequence support
|
||||
// Convenience for users
|
||||
typedef ::boost::parameter::aux::tagged_argument<Keyword,Arg> type;
|
||||
// For the benefit of iterators
|
||||
typedef ::boost::parameter::aux::empty_arg_list tail_type;
|
||||
// For dispatching to sequence intrinsics
|
||||
typedef ::boost::parameter::aux::arg_list_tag tag;
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
|
||||
// warning suppression
|
||||
private:
|
||||
void operator=(type const&);
|
||||
#endif
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename TaggedArg>
|
||||
struct tagged_argument_list_of_1 : public TaggedArg
|
||||
{
|
||||
using base_type = TaggedArg;
|
||||
|
||||
inline explicit BOOST_CONSTEXPR tagged_argument_list_of_1(
|
||||
typename base_type::reference x
|
||||
) : base_type(static_cast<typename base_type::reference>(x))
|
||||
{
|
||||
}
|
||||
|
||||
inline BOOST_CONSTEXPR tagged_argument_list_of_1(
|
||||
tagged_argument_list_of_1 const& copy
|
||||
) : base_type(static_cast<base_type const&>(copy))
|
||||
{
|
||||
}
|
||||
|
||||
using base_type::operator[];
|
||||
using base_type::satisfies;
|
||||
|
||||
template <typename TA2>
|
||||
inline BOOST_CONSTEXPR ::boost::parameter::aux::flat_like_arg_list<
|
||||
::boost::parameter::aux
|
||||
::flat_like_arg_tuple<typename TaggedArg::key_type,TaggedArg>
|
||||
, ::boost::parameter::aux::flat_like_arg_tuple<
|
||||
typename TA2::base_type::key_type
|
||||
, typename TA2::base_type
|
||||
>
|
||||
>
|
||||
operator,(TA2 const& x) const
|
||||
{
|
||||
return boost::parameter::aux::flat_like_arg_list<
|
||||
::boost::parameter::aux
|
||||
::flat_like_arg_tuple<typename TaggedArg::key_type,TaggedArg>
|
||||
, ::boost::parameter::aux::flat_like_arg_tuple<
|
||||
typename TA2::base_type::key_type
|
||||
, typename TA2::base_type
|
||||
>
|
||||
>(
|
||||
static_cast<base_type const&>(*this)
|
||||
, ::boost::parameter::aux::arg_list<typename TA2::base_type>(
|
||||
static_cast<typename TA2::base_type const&>(x)
|
||||
, ::boost::parameter::aux::empty_arg_list()
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
#endif // include guard
|
||||
|
||||
|
||||
38
include/boost/parameter/aux_/tagged_argument_fwd.hpp
Normal file
38
include/boost/parameter/aux_/tagged_argument_fwd.hpp
Normal file
@@ -0,0 +1,38 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_TAGGED_ARGUMENT_FWD_HPP
|
||||
#define BOOST_PARAMETER_TAGGED_ARGUMENT_FWD_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Keyword, typename Arg>
|
||||
class tagged_argument;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename Keyword, typename Arg>
|
||||
struct tagged_argument_rref;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename TaggedArg>
|
||||
struct tagged_argument_list_of_1;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif
|
||||
#endif // include guard
|
||||
|
||||
89
include/boost/parameter/aux_/template_keyword.hpp
Normal file
89
include/boost/parameter/aux_/template_keyword.hpp
Normal file
@@ -0,0 +1,89 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
|
||||
#define BOOST_PARAMETER_TEMPLATE_KEYWORD_060203_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
struct template_keyword_base
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <type_traits>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
using is_template_keyword = ::std::is_base_of<
|
||||
::boost::parameter::aux::template_keyword_base
|
||||
, typename ::std::remove_const<
|
||||
typename ::std::remove_reference<T>::type
|
||||
>::type
|
||||
>;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#else
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
#include <boost/type_traits/is_lvalue_reference.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
#if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
template <typename T>
|
||||
struct is_template_keyword_aux
|
||||
: ::boost::mpl::if_<
|
||||
::boost::is_convertible<
|
||||
T*
|
||||
, ::boost::parameter::aux::template_keyword_base const*
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
|
||||
template <typename T>
|
||||
struct is_template_keyword
|
||||
: ::boost::mpl::if_<
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
// Cannot use is_convertible<> to check if T is derived from
|
||||
// template_keyword_base. -- Cromwell D. Enage
|
||||
::boost::is_base_of<
|
||||
::boost::parameter::aux::template_keyword_base
|
||||
, typename ::boost::remove_const<
|
||||
typename ::boost::remove_reference<T>::type
|
||||
>::type
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
#else
|
||||
::boost::is_lvalue_reference<T>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::parameter::aux::is_template_keyword_aux<T>
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
>::type
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
#endif // include guard
|
||||
|
||||
247
include/boost/parameter/aux_/unwrap_cv_reference.hpp
Executable file → Normal file
247
include/boost/parameter/aux_/unwrap_cv_reference.hpp
Executable file → Normal file
@@ -1,97 +1,174 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UNWRAP_CV_REFERENCE_050328_HPP
|
||||
#define UNWRAP_CV_REFERENCE_050328_HPP
|
||||
#ifndef BOOST_PARAMETER_AUX_UNWRAP_CV_REFERENCE_HPP
|
||||
#define BOOST_PARAMETER_AUX_UNWRAP_CV_REFERENCE_HPP
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T>
|
||||
class reference_wrapper;
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/parameter/aux_/yesno.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
|
||||
namespace boost { template<class T> class reference_wrapper; }
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
//
|
||||
// reference_wrapper support -- because of the forwarding problem,
|
||||
// when passing arguments positionally by non-const reference, we
|
||||
// ask users of named parameter interfaces to use ref(x) to wrap
|
||||
// them.
|
||||
//
|
||||
//
|
||||
// reference_wrapper support -- if perfect forwarding is unsupported,
|
||||
// then when passing arguments positionally by non-const reference,
|
||||
// we ask users of named parameter interfaces to use ref(x) to wrap them.
|
||||
//
|
||||
|
||||
// is_cv_reference_wrapper returns mpl::true_ if T is of type
|
||||
// reference_wrapper<U> cv
|
||||
template <class U>
|
||||
yes_tag is_cv_reference_wrapper_check(reference_wrapper<U> const volatile*);
|
||||
no_tag is_cv_reference_wrapper_check(...);
|
||||
|
||||
template <class T>
|
||||
struct is_cv_reference_wrapper
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value = (
|
||||
sizeof(is_cv_reference_wrapper_check((T*)0)) == sizeof(yes_tag)
|
||||
)
|
||||
);
|
||||
|
||||
typedef mpl::bool_<
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
is_cv_reference_wrapper::
|
||||
#endif
|
||||
value> type;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(MSVC, == 1200)
|
||||
template <>
|
||||
struct is_cv_reference_wrapper<int>
|
||||
: mpl::false_ {};
|
||||
#endif
|
||||
|
||||
// Needed for unwrap_cv_reference below. T might be const, so
|
||||
// eval_if might fail because of deriving from T const on EDG.
|
||||
template <class T>
|
||||
struct get_type
|
||||
{
|
||||
typedef typename T::type type;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
template <class T, class is_reference_wrapper = typename is_cv_reference_wrapper<T>::type>
|
||||
struct unwrap_cv_reference
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct unwrap_cv_reference<T const, mpl::false_>
|
||||
{
|
||||
typedef T const type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct unwrap_cv_reference<T, mpl::true_>
|
||||
: T
|
||||
{};
|
||||
|
||||
#else
|
||||
// Produces the unwrapped type to hold a reference to in named<>
|
||||
// Can't use boost::unwrap_reference<> here because it
|
||||
// doesn't handle the case where T = reference_wrapper<U> cv
|
||||
template <class T>
|
||||
struct unwrap_cv_reference
|
||||
{
|
||||
typedef typename mpl::eval_if<
|
||||
is_cv_reference_wrapper<T>
|
||||
, get_type<T>
|
||||
, mpl::identity<T>
|
||||
>::type type;
|
||||
};
|
||||
#endif
|
||||
template <typename U>
|
||||
::boost::parameter::aux::yes_tag
|
||||
is_cv_reference_wrapper_check(
|
||||
::boost::reference_wrapper<U> const volatile*
|
||||
);
|
||||
|
||||
::boost::parameter::aux::no_tag is_cv_reference_wrapper_check(...);
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // UNWRAP_CV_REFERENCE_050328_HPP
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_FUNCTIONAL)
|
||||
#include <functional>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// Support for std::ref(x) -- Cromwell D. Enage
|
||||
template <typename U>
|
||||
::boost::parameter::aux::yes_tag
|
||||
is_cv_reference_wrapper_check(
|
||||
::std::reference_wrapper<U> const volatile*
|
||||
);
|
||||
}}} // namespace boost::parameter::aux
|
||||
#endif
|
||||
|
||||
#include <boost/parameter/aux_/preprocessor/nullptr.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11) && !( \
|
||||
BOOST_WORKAROUND(BOOST_MSVC, >= 1900) && \
|
||||
BOOST_WORKAROUND(BOOST_MSVC, < 1910) \
|
||||
)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11) || MSVC-14.0
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
|
||||
!BOOST_WORKAROUND(BOOST_GCC, < 40000)
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#endif
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11 && not MSVC-14.0
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11) && !( \
|
||||
BOOST_WORKAROUND(BOOST_MSVC, >= 1900) && \
|
||||
BOOST_WORKAROUND(BOOST_MSVC, < 1910) \
|
||||
)
|
||||
// This metafunction returns mp11::mp_true if T is of type
|
||||
// reference_wrapper<U> cv.
|
||||
template <typename T>
|
||||
using is_cv_reference_wrapper = ::boost::mp11::mp_bool<
|
||||
sizeof(
|
||||
::boost::parameter::aux::is_cv_reference_wrapper_check(
|
||||
static_cast<
|
||||
typename ::std::remove_reference<T>::type*
|
||||
>(BOOST_PARAMETER_AUX_PP_NULLPTR)
|
||||
)
|
||||
) == sizeof(::boost::parameter::aux::yes_tag)
|
||||
>;
|
||||
|
||||
// Needed for unwrap_cv_reference below. T might be const, so
|
||||
// mp_eval_if<> might fail because of deriving from T const on EDG.
|
||||
template <typename T>
|
||||
using unwrap_cv_reference_impl = typename ::std::remove_reference<T>::type;
|
||||
|
||||
// Produces the unwrapped type to hold a reference to in
|
||||
// tagged_argument<>. Can't use boost::unwrap_reference<> here
|
||||
// because it doesn't handle the case where T = reference_wrapper<U> cv.
|
||||
template <typename T>
|
||||
using unwrap_cv_reference = ::boost::mp11::mp_eval_if<
|
||||
::boost::parameter::aux::is_cv_reference_wrapper<T>
|
||||
, ::boost::parameter::aux::unwrap_cv_reference_impl<T>
|
||||
, ::std::remove_reference
|
||||
, T
|
||||
>;
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11) || MSVC-14.0
|
||||
// This metafunction returns mpl::true_ if T is of type
|
||||
// reference_wrapper<U> cv.
|
||||
template <typename T>
|
||||
struct is_cv_reference_wrapper
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool, value = (
|
||||
sizeof(
|
||||
::boost::parameter::aux::is_cv_reference_wrapper_check(
|
||||
static_cast<
|
||||
typename ::boost::remove_reference<T>::type*
|
||||
>(BOOST_PARAMETER_AUX_PP_NULLPTR)
|
||||
)
|
||||
) == sizeof(::boost::parameter::aux::yes_tag)
|
||||
)
|
||||
);
|
||||
|
||||
typedef boost::mpl::bool_<
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
is_cv_reference_wrapper::
|
||||
#endif
|
||||
value> type;
|
||||
};
|
||||
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) || \
|
||||
BOOST_WORKAROUND(BOOST_GCC, < 40000)
|
||||
template <
|
||||
typename T
|
||||
, typename = typename ::boost::parameter::aux
|
||||
::is_cv_reference_wrapper<T>::type
|
||||
>
|
||||
struct unwrap_cv_reference : ::boost::remove_reference<T>
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct unwrap_cv_reference<T const,::boost::mpl::false_>
|
||||
{
|
||||
typedef T const type;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct unwrap_cv_reference<T,::boost::mpl::true_> : T
|
||||
{
|
||||
};
|
||||
#else // no Borland or GCC 3- workarounds needed
|
||||
// Needed for unwrap_cv_reference below. T might be const, so
|
||||
// eval_if<> might fail because of deriving from T const on EDG.
|
||||
template <typename T>
|
||||
struct unwrap_cv_reference_impl : ::boost::remove_reference<T>::type
|
||||
{
|
||||
};
|
||||
|
||||
// Produces the unwrapped type to hold a reference to in
|
||||
// tagged_argument<>. Can't use boost::unwrap_reference<> here
|
||||
// because it doesn't handle the case where T = reference_wrapper<U> cv.
|
||||
template <typename T>
|
||||
struct unwrap_cv_reference
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::parameter::aux::is_cv_reference_wrapper<T>
|
||||
, ::boost::parameter::aux::unwrap_cv_reference_impl<T>
|
||||
, ::boost::remove_reference<T>
|
||||
>
|
||||
{
|
||||
};
|
||||
#endif // Borland or GCC 3- workarounds needed
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11 && not MSVC-14.0
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
|
||||
17
include/boost/parameter/aux_/use_default.hpp
Normal file
17
include/boost/parameter/aux_/use_default.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_AUX_USE_DEFAULT_HPP
|
||||
#define BOOST_PARAMETER_AUX_USE_DEFAULT_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
struct use_default
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
29
include/boost/parameter/aux_/use_default_tag.hpp
Normal file
29
include/boost/parameter/aux_/use_default_tag.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright Daniel Wallin 2006.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_USE_DEFAULT_TAG_HPP
|
||||
#define BOOST_PARAMETER_USE_DEFAULT_TAG_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
struct use_default_tag
|
||||
{
|
||||
inline BOOST_CONSTEXPR BOOST_DEFAULTED_FUNCTION(use_default_tag(), {})
|
||||
|
||||
inline BOOST_CONSTEXPR BOOST_DEFAULTED_FUNCTION(
|
||||
use_default_tag(use_default_tag const&), {}
|
||||
)
|
||||
|
||||
inline BOOST_CONSTEXPR use_default_tag operator()() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
40
include/boost/parameter/aux_/void.hpp
Executable file → Normal file
40
include/boost/parameter/aux_/void.hpp
Executable file → Normal file
@@ -1,18 +1,38 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef VOID_050329_HPP
|
||||
#define VOID_050329_HPP
|
||||
#ifndef BOOST_PARAMETER_VOID_050329_HPP
|
||||
#define BOOST_PARAMETER_VOID_050329_HPP
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
// A placemarker for "no argument passed."
|
||||
// MAINTAINER NOTE: Do not make this into a metafunction
|
||||
struct void_
|
||||
{
|
||||
};
|
||||
}} // namespace boost::parameter
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// A placemarker for "no argument passed."
|
||||
// MAINTAINER NOTE: Do not make this into a metafunction
|
||||
struct void_ {};
|
||||
|
||||
inline ::boost::parameter::void_& void_reference()
|
||||
{
|
||||
static ::boost::parameter::void_ instance;
|
||||
return instance;
|
||||
}
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // VOID_050329_HPP
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
typedef void* voidstar;
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif
|
||||
#endif // include guard
|
||||
|
||||
|
||||
48
include/boost/parameter/aux_/yesno.hpp
Executable file → Normal file
48
include/boost/parameter/aux_/yesno.hpp
Executable file → Normal file
@@ -1,26 +1,42 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef YESNO_050328_HPP
|
||||
#define YESNO_050328_HPP
|
||||
#ifndef BOOST_PARAMETER_AUX_YESNO_HPP
|
||||
#define BOOST_PARAMETER_AUX_YESNO_HPP
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// types used with the "sizeof trick" to capture the results of
|
||||
// overload resolution at compile-time.
|
||||
typedef char yes_tag;
|
||||
typedef char (&no_tag)[2];
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// types used with the "sizeof trick" to capture the results of
|
||||
// overload resolution at compile-time.
|
||||
typedef char yes_tag;
|
||||
typedef char (&no_tag)[2];
|
||||
|
||||
// mpl::true_ and mpl::false_ are not distinguishable by sizeof(),
|
||||
// so we pass them through these functions to get a type that is.
|
||||
yes_tag to_yesno(mpl::true_);
|
||||
no_tag to_yesno(mpl::false_);
|
||||
|
||||
// mpl::true_ and mpl::false_ are not distinguishable by sizeof(),
|
||||
// so we pass them through these functions to get a type that is.
|
||||
::boost::parameter::aux::yes_tag to_yesno(::boost::mpl::true_);
|
||||
::boost::parameter::aux::no_tag to_yesno(::boost::mpl::false_);
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // YESNO_050328_HPP
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
// mp11::mp_true and mp11::mp_false are not distinguishable by sizeof(),
|
||||
// so we pass them through these functions to get a type that is.
|
||||
::boost::parameter::aux::yes_tag to_yesno(::boost::mp11::mp_true);
|
||||
::boost::parameter::aux::no_tag to_yesno(::boost::mp11::mp_false);
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
#endif // include guard
|
||||
|
||||
|
||||
199
include/boost/parameter/binding.hpp
Executable file → Normal file
199
include/boost/parameter/binding.hpp
Executable file → Normal file
@@ -1,57 +1,164 @@
|
||||
// Copyright David Abrahams 2005. Distributed under the Boost
|
||||
// Software License, Version 1.0. (See accompanying
|
||||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
// Copyright David Abrahams 2005.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_BINDING_DWA200558_HPP
|
||||
# define BOOST_PARAMETER_BINDING_DWA200558_HPP
|
||||
#define BOOST_PARAMETER_BINDING_DWA200558_HPP
|
||||
|
||||
# include <boost/mpl/apply.hpp>
|
||||
# include <boost/parameter/aux_/result_of0.hpp>
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
# include <boost/parameter/aux_/void.hpp>
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
# include <boost/parameter/aux_/void.hpp>
|
||||
# include <boost/type_traits/is_same.hpp>
|
||||
# endif
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/list.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/mpl/identity.hpp>
|
||||
#include <boost/mpl/apply_wrap.hpp>
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
// A metafunction that, given an argument pack, returns the type of
|
||||
// the parameter identified by the given keyword. If no such
|
||||
// parameter has been specified, returns Default
|
||||
# if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template <class Parameters, class Keyword, class Default = void>
|
||||
struct binding
|
||||
: mpl::apply_wrap2<
|
||||
typename Parameters::binding,Keyword,Default
|
||||
>
|
||||
{};
|
||||
# else
|
||||
template <class Parameters, class Keyword, class Default = aux::void_>
|
||||
struct binding
|
||||
{
|
||||
typedef typename mpl::apply_wrap2<
|
||||
typename Parameters::binding,Keyword,
|
||||
typename mpl::if_<is_same<Default,aux::void_>,void,Default>::type
|
||||
>::type type;
|
||||
};
|
||||
# endif
|
||||
// A metafunction that, given an argument pack, returns the reference type
|
||||
// of the parameter identified by the given keyword. If no such parameter
|
||||
// has been specified, returns Default
|
||||
|
||||
// A metafunction that, given an argument pack, returns the type of
|
||||
// the parameter identified by the given keyword. If no such
|
||||
// parameter has been specified, returns the type returned by invoking
|
||||
// DefaultFn
|
||||
template <class Parameters, class Keyword, class DefaultFn>
|
||||
struct lazy_binding
|
||||
{
|
||||
typedef typename mpl::apply_wrap2<
|
||||
typename Parameters::binding
|
||||
, Keyword
|
||||
, typename aux::result_of0<DefaultFn>::type
|
||||
>::type type;
|
||||
};
|
||||
template <typename Parameters, typename Keyword, typename Default>
|
||||
struct binding0
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = ::boost::mp11::mp_apply_q<
|
||||
typename Parameters::binding
|
||||
, ::boost::mp11::mp_list<Keyword,Default,::boost::mp11::mp_true>
|
||||
>;
|
||||
|
||||
static_assert(
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_same<Default,::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_same<type,::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
>::value
|
||||
, "required parameters must not result in void_ type"
|
||||
);
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typedef typename ::boost::mpl::apply_wrap3<
|
||||
typename Parameters::binding
|
||||
, Keyword
|
||||
, Default
|
||||
, ::boost::mpl::true_
|
||||
>::type type;
|
||||
|
||||
BOOST_MPL_ASSERT((
|
||||
typename ::boost::mpl::eval_if<
|
||||
::boost::is_same<Default,::boost::parameter::void_>
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_same<type,::boost::parameter::void_>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
>::type
|
||||
));
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
};
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename Placeholder, typename Keyword, typename Default>
|
||||
struct binding1
|
||||
{
|
||||
using type = ::boost::mp11::mp_apply_q<
|
||||
Placeholder
|
||||
, ::boost::mp11::mp_list<Keyword,Default,::boost::mp11::mp_true>
|
||||
>;
|
||||
|
||||
static_assert(
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_same<Default,::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_same<type,::boost::parameter::void_>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
>::value
|
||||
, "required parameters must not result in void_ type"
|
||||
);
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#endif // BOOST_PARAMETER_BINDING_DWA200558_HPP
|
||||
#include <boost/parameter/aux_/is_placeholder.hpp>
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
template <
|
||||
typename Parameters
|
||||
, typename Keyword
|
||||
, typename Default = ::boost::parameter::void_
|
||||
>
|
||||
struct binding
|
||||
#if !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
: ::boost::mpl::eval_if<
|
||||
::boost::parameter::aux::is_mpl_placeholder<Parameters>
|
||||
, ::boost::mpl::identity<int>
|
||||
, ::boost::parameter::binding0<Parameters,Keyword,Default>
|
||||
>
|
||||
#endif
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = typename ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::is_mpl_placeholder<Parameters>
|
||||
, ::boost::mp11::mp_identity<int>
|
||||
, ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::is_mp11_placeholder<Parameters>
|
||||
, ::boost::parameter::binding1<Parameters,Keyword,Default>
|
||||
, ::boost::parameter::binding0<Parameters,Keyword,Default>
|
||||
>
|
||||
>::type;
|
||||
#endif
|
||||
};
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#include <boost/parameter/aux_/result_of0.hpp>
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
// A metafunction that, given an argument pack, returns the reference type
|
||||
// of the parameter identified by the given keyword. If no such parameter
|
||||
// has been specified, returns the type returned by invoking DefaultFn
|
||||
template <typename Parameters, typename Keyword, typename DefaultFn>
|
||||
struct lazy_binding
|
||||
{
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using type = ::boost::mp11::mp_apply_q<
|
||||
typename Parameters::binding
|
||||
, ::boost::mp11::mp_list<
|
||||
Keyword
|
||||
, typename ::boost::parameter::aux::result_of0<DefaultFn>::type
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
>;
|
||||
#else
|
||||
typedef typename ::boost::mpl::apply_wrap3<
|
||||
typename Parameters::binding
|
||||
, Keyword
|
||||
, typename ::boost::parameter::aux::result_of0<DefaultFn>::type
|
||||
, ::boost::mpl::true_
|
||||
>::type type;
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
};
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#endif // include guard
|
||||
|
||||
|
||||
210
include/boost/parameter/compose.hpp
Normal file
210
include/boost/parameter/compose.hpp
Normal file
@@ -0,0 +1,210 @@
|
||||
// Copyright Cromwell D. Enage 2019.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_COMPOSE_HPP
|
||||
#define BOOST_PARAMETER_COMPOSE_HPP
|
||||
|
||||
#include <boost/parameter/aux_/arg_list.hpp>
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
inline BOOST_CONSTEXPR ::boost::parameter::aux::empty_arg_list compose()
|
||||
{
|
||||
return ::boost::parameter::aux::empty_arg_list();
|
||||
}
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename ...TaggedArgs>
|
||||
struct compose_arg_list
|
||||
{
|
||||
using type = ::boost::parameter::aux::flat_like_arg_list<
|
||||
::boost::parameter::aux::flat_like_arg_tuple<
|
||||
typename TaggedArgs::base_type::key_type
|
||||
, typename TaggedArgs::base_type
|
||||
>...
|
||||
>;
|
||||
};
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
template <typename TaggedArg0, typename ...TaggedArgs>
|
||||
struct compose_arg_list;
|
||||
|
||||
template <typename TaggedArg0>
|
||||
struct compose_arg_list<TaggedArg0>
|
||||
{
|
||||
typedef ::boost::parameter::aux::arg_list<TaggedArg0> type;
|
||||
};
|
||||
|
||||
template <typename TaggedArg0, typename ...TaggedArgs>
|
||||
struct compose_arg_list
|
||||
{
|
||||
typedef ::boost::parameter::aux::arg_list<
|
||||
TaggedArg0
|
||||
, typename ::boost::parameter::aux
|
||||
::compose_arg_list<TaggedArgs...>::type
|
||||
> type;
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/are_tagged_arguments.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace result_of {
|
||||
|
||||
template <typename ...TaggedArgs>
|
||||
struct compose
|
||||
: ::boost::lazy_enable_if<
|
||||
::boost::parameter::are_tagged_arguments<TaggedArgs...>
|
||||
, ::boost::parameter::aux::compose_arg_list<TaggedArgs...>
|
||||
>
|
||||
{
|
||||
};
|
||||
|
||||
template <>
|
||||
struct compose<>
|
||||
{
|
||||
typedef ::boost::parameter::aux::empty_arg_list type;
|
||||
};
|
||||
}}} // namespace boost::parameter::result_of
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
template <typename TaggedArg0, typename ...TaggedArgs>
|
||||
inline BOOST_CONSTEXPR typename ::boost::parameter::result_of
|
||||
::compose<TaggedArg0,TaggedArgs...>::type
|
||||
compose(TaggedArg0 const& arg0, TaggedArgs const&... args)
|
||||
{
|
||||
return typename ::boost::parameter::aux
|
||||
::compose_arg_list<TaggedArg0,TaggedArgs...>::type(
|
||||
::boost::parameter::aux::value_type_is_not_void()
|
||||
, arg0
|
||||
, args...
|
||||
);
|
||||
}
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
#define BOOST_PARAMETER_compose_arg_list_type_suffix(z, n, suffix) suffix
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_compose_arg_list_type_prefix(z, n, prefix) \
|
||||
::boost::parameter::aux::arg_list<BOOST_PP_CAT(prefix, n)
|
||||
/**/
|
||||
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
|
||||
#define BOOST_PARAMETER_compose_arg_list_type(z, n, prefix) \
|
||||
BOOST_PP_CAT(BOOST_PP_ENUM_, z)( \
|
||||
n, BOOST_PARAMETER_compose_arg_list_type_prefix, prefix \
|
||||
) BOOST_PP_CAT(BOOST_PP_REPEAT_, z)( \
|
||||
n, BOOST_PARAMETER_compose_arg_list_type_suffix, > \
|
||||
)
|
||||
/**/
|
||||
|
||||
#include <boost/parameter/aux_/void.hpp>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
|
||||
|
||||
#if defined(BOOST_NO_SFINAE)
|
||||
#define BOOST_PARAMETER_compose_arg_list_function_overload(z, n, prefix) \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename prefix)> \
|
||||
inline BOOST_CONSTEXPR \
|
||||
BOOST_PARAMETER_compose_arg_list_type(z, n, prefix) \
|
||||
compose(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, prefix, const& a)) \
|
||||
{ \
|
||||
return BOOST_PARAMETER_compose_arg_list_type(z, n, prefix)( \
|
||||
BOOST_PP_ENUM_PARAMS_Z(z, n, a) \
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS_Z( \
|
||||
z \
|
||||
, BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, n) \
|
||||
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT \
|
||||
) \
|
||||
); \
|
||||
}
|
||||
/**/
|
||||
#else // !defined(BOOST_NO_SFINAE)
|
||||
#include <boost/parameter/are_tagged_arguments.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
|
||||
namespace boost { namespace parameter { namespace result_of {
|
||||
|
||||
template <
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(
|
||||
BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY)
|
||||
, typename TaggedArg
|
||||
, = void BOOST_PP_INTERCEPT
|
||||
)
|
||||
>
|
||||
struct compose;
|
||||
|
||||
template <>
|
||||
struct compose<>
|
||||
{
|
||||
typedef ::boost::parameter::aux::empty_arg_list type;
|
||||
};
|
||||
}}} // namespace boost::parameter::result_of
|
||||
|
||||
#define BOOST_PARAMETER_compose_arg_list_function_overload(z, n, prefix) \
|
||||
namespace boost { namespace parameter { namespace result_of { \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename prefix)> \
|
||||
struct compose<BOOST_PP_ENUM_PARAMS_Z(z, n, prefix)> \
|
||||
: ::boost::enable_if< \
|
||||
::boost::parameter \
|
||||
::are_tagged_arguments<BOOST_PP_ENUM_PARAMS_Z(z, n, prefix)> \
|
||||
, BOOST_PARAMETER_compose_arg_list_type(z, n, prefix) \
|
||||
> \
|
||||
{ \
|
||||
}; \
|
||||
}}} \
|
||||
namespace boost { namespace parameter { \
|
||||
template <BOOST_PP_ENUM_PARAMS_Z(z, n, typename prefix)> \
|
||||
inline BOOST_CONSTEXPR typename ::boost::parameter::result_of \
|
||||
::compose<BOOST_PP_ENUM_PARAMS_Z(z, n, prefix)>::type \
|
||||
compose(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, n, prefix, const& a)) \
|
||||
{ \
|
||||
return BOOST_PARAMETER_compose_arg_list_type(z, n, prefix)( \
|
||||
BOOST_PP_ENUM_PARAMS_Z(z, n, a) \
|
||||
BOOST_PP_ENUM_TRAILING_PARAMS_Z( \
|
||||
z \
|
||||
, BOOST_PP_SUB(BOOST_PARAMETER_COMPOSE_MAX_ARITY, n) \
|
||||
, ::boost::parameter::aux::void_reference() BOOST_PP_INTERCEPT \
|
||||
) \
|
||||
); \
|
||||
} \
|
||||
}}
|
||||
/**/
|
||||
#endif // BOOST_NO_SFINAE
|
||||
|
||||
#include <boost/preprocessor/repetition/repeat_from_to.hpp>
|
||||
|
||||
BOOST_PP_REPEAT_FROM_TO(
|
||||
1
|
||||
, BOOST_PP_INC(BOOST_PARAMETER_COMPOSE_MAX_ARITY)
|
||||
, BOOST_PARAMETER_compose_arg_list_function_overload
|
||||
, TaggedArg
|
||||
)
|
||||
|
||||
#undef BOOST_PARAMETER_compose_arg_list_function_overload
|
||||
#undef BOOST_PARAMETER_compose_arg_list_type
|
||||
#undef BOOST_PARAMETER_compose_arg_list_type_prefix
|
||||
#undef BOOST_PARAMETER_compose_arg_list_type_suffix
|
||||
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
#endif // include guard
|
||||
|
||||
81
include/boost/parameter/config.hpp
Executable file → Normal file
81
include/boost/parameter/config.hpp
Executable file → Normal file
@@ -1,14 +1,83 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_CONFIG_050403_HPP
|
||||
#define BOOST_PARAMETER_CONFIG_050403_HPP
|
||||
|
||||
#ifndef BOOST_PARAMETER_MAX_ARITY
|
||||
# define BOOST_PARAMETER_MAX_ARITY 5
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/config/workaround.hpp>
|
||||
|
||||
// Allow projects to #define BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING to
|
||||
// turn off perfect forwarding as necessary. Otherwise, also require correct
|
||||
// SFINAE support, needed explicitly by tagged_argument & keyword & cast;
|
||||
// correct function template ordering, needed by the code generation macros;
|
||||
// rvalue references, needed throughout; variadic templates, needed by
|
||||
// parameters; function template default arguments, needed by the code
|
||||
// generation macros; and the ability to handle multiple parameter packs,
|
||||
// needed by parameters. Older versions of GCC either don't have the latter
|
||||
// ability or cannot disambiguate between keyword's overloaded
|
||||
// operators. Older versions of Clang either fail to compile due to
|
||||
// differences in length between parameter packs 'Args' and 'args' or fail at
|
||||
// runtime due to segmentation faults.
|
||||
// -- Cromwell D. Enage
|
||||
#if !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING) && \
|
||||
!defined(BOOST_PARAMETER_DISABLE_PERFECT_FORWARDING) && \
|
||||
!defined(BOOST_NO_SFINAE) && \
|
||||
!defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) && \
|
||||
!defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && \
|
||||
!defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && \
|
||||
!defined(BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && \
|
||||
!BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && !( \
|
||||
defined(BOOST_CLANG) && (1 == BOOST_CLANG) && ( \
|
||||
(__clang_major__ < 3) || ( \
|
||||
(3 == __clang_major__) && (__clang_minor__ < 2) \
|
||||
) \
|
||||
) \
|
||||
) && !BOOST_WORKAROUND(BOOST_GCC, < 40900)
|
||||
#define BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
#endif
|
||||
|
||||
#endif // BOOST_PARAMETER_CONFIG_050403_HPP
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#if !defined(BOOST_PARAMETER_CAN_USE_MP11) && \
|
||||
!defined(BOOST_PARAMETER_DISABLE_MP11_USAGE) && \
|
||||
!defined(BOOST_NO_CXX11_CONSTEXPR) && \
|
||||
!defined(BOOST_NO_CXX11_DECLTYPE_N3276) && \
|
||||
!defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) && \
|
||||
!defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && \
|
||||
!defined(BOOST_NO_CXX11_STATIC_ASSERT) && \
|
||||
!defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) && \
|
||||
!defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) && \
|
||||
!defined(BOOST_NO_CXX11_HDR_TUPLE)
|
||||
// Boost.MP11 requires C++11. -- Cromwell D. Enage
|
||||
#define BOOST_PARAMETER_CAN_USE_MP11
|
||||
#endif
|
||||
#if !defined(BOOST_PARAMETER_MAX_ARITY)
|
||||
// Unlike the variadic MPL sequences provided by Boost.Fusion,
|
||||
// boost::mpl::vector has a size limit. -- Cromwell D. Enage
|
||||
#include <boost/mpl/limits/vector.hpp>
|
||||
#define BOOST_PARAMETER_MAX_ARITY BOOST_MPL_LIMIT_VECTOR_SIZE
|
||||
#endif
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#if !defined(BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY)
|
||||
#define BOOST_PARAMETER_EXPONENTIAL_OVERLOAD_THRESHOLD_ARITY 0
|
||||
#endif
|
||||
#if !defined(BOOST_PARAMETER_COMPOSE_MAX_ARITY)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1800) || \
|
||||
BOOST_WORKAROUND(BOOST_GCC, < 60000)
|
||||
// Some tests cause MSVC-11.0 and earlier to run out of heap space,
|
||||
// while some other tests cause GCC 5 and earlier to do the same,
|
||||
// if the value is set any higher. -- Cromwell D. Enage
|
||||
#define BOOST_PARAMETER_COMPOSE_MAX_ARITY 20
|
||||
#else
|
||||
#define BOOST_PARAMETER_COMPOSE_MAX_ARITY 64
|
||||
#endif
|
||||
#endif // BOOST_PARAMETER_COMPOSE_MAX_ARITY
|
||||
#if !defined(BOOST_PARAMETER_MAX_ARITY)
|
||||
#define BOOST_PARAMETER_MAX_ARITY 8
|
||||
#endif
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
#endif // include guard
|
||||
|
||||
|
||||
132
include/boost/parameter/deduced.hpp
Normal file
132
include/boost/parameter/deduced.hpp
Normal file
@@ -0,0 +1,132 @@
|
||||
// Copyright David Abrahams, Daniel Wallin 2003.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_DEDUCED_HPP
|
||||
#define BOOST_PARAMETER_DEDUCED_HPP
|
||||
|
||||
#include <boost/parameter/aux_/use_default.hpp>
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
// This metafunction can be used to describe the treatment of particular
|
||||
// named parameters for the purposes of overload elimination with SFINAE,
|
||||
// by placing specializations in the parameters<...> list.
|
||||
//
|
||||
// If a keyword k is specified with deduced<...>, that keyword
|
||||
// will be automatically deduced from the argument list.
|
||||
template <typename Tag>
|
||||
struct deduced
|
||||
{
|
||||
typedef Tag key_type;
|
||||
};
|
||||
}}
|
||||
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
template <typename T>
|
||||
struct is_deduced_aux
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
: ::boost::mp11::mp_false
|
||||
#else
|
||||
: ::boost::mpl::false_
|
||||
#endif
|
||||
{
|
||||
};
|
||||
|
||||
template <typename Tag>
|
||||
struct is_deduced_aux< ::boost::parameter::deduced<Tag> >
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
: ::boost::mp11::mp_true
|
||||
#else
|
||||
: ::boost::mpl::true_
|
||||
#endif
|
||||
{
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct is_deduced0
|
||||
: ::boost::parameter::aux::is_deduced_aux<typename T::key_type>::type
|
||||
{
|
||||
};
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#include <boost/parameter/required.hpp>
|
||||
#include <boost/parameter/optional.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#else
|
||||
#include <boost/mpl/if.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter { namespace aux {
|
||||
|
||||
//
|
||||
// tag_type, has_default, and predicate --
|
||||
//
|
||||
// These metafunctions accept a ParameterSpec and extract the
|
||||
// keyword tag, whether or not a default is supplied for the
|
||||
// parameter, and the predicate that the corresponding actual
|
||||
// argument type is required match.
|
||||
//
|
||||
// a ParameterSpec is a specialization of either keyword<...>,
|
||||
// required<...>, optional<...>
|
||||
//
|
||||
|
||||
template <typename T>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using has_default = ::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::is_required<T>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>;
|
||||
#else
|
||||
struct has_default
|
||||
: ::boost::mpl::if_<
|
||||
::boost::parameter::aux::is_required<T>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
using is_deduced = ::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_if<
|
||||
::boost::parameter::aux::is_optional<T>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::boost::parameter::aux::is_required<T>
|
||||
>
|
||||
, ::boost::parameter::aux::is_deduced0<T>
|
||||
, ::boost::mp11::mp_false
|
||||
>;
|
||||
#else
|
||||
struct is_deduced
|
||||
: ::boost::mpl::if_<
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::parameter::aux::is_optional<T>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::parameter::aux::is_required<T>
|
||||
>::type
|
||||
, ::boost::parameter::aux::is_deduced0<T>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
{
|
||||
};
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
}}} // namespace boost::parameter::aux
|
||||
|
||||
#endif // include guard
|
||||
|
||||
29
include/boost/parameter/is_argument_pack.hpp
Normal file
29
include/boost/parameter/is_argument_pack.hpp
Normal file
@@ -0,0 +1,29 @@
|
||||
// Copyright Cromwell D. Enage 2018.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_IS_ARGUMENT_PACK_HPP
|
||||
#define BOOST_PARAMETER_IS_ARGUMENT_PACK_HPP
|
||||
|
||||
#include <boost/parameter/aux_/is_tagged_argument.hpp>
|
||||
#include <boost/parameter/aux_/arg_list.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/type_traits/is_base_of.hpp>
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
template <typename T>
|
||||
struct is_argument_pack
|
||||
: ::boost::mpl::if_<
|
||||
::boost::is_base_of< ::boost::parameter::aux::empty_arg_list,T>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::parameter::aux::is_tagged_argument<T>
|
||||
>::type
|
||||
{
|
||||
};
|
||||
}}
|
||||
|
||||
#endif // include guard
|
||||
|
||||
828
include/boost/parameter/keyword.hpp
Executable file → Normal file
828
include/boost/parameter/keyword.hpp
Executable file → Normal file
@@ -1,134 +1,744 @@
|
||||
// Copyright Daniel Wallin, David Abrahams 2005. Use, modification and
|
||||
// distribution is subject to the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// Copyright Daniel Wallin, David Abrahams 2005.
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef KEYWORD_050328_HPP
|
||||
#define KEYWORD_050328_HPP
|
||||
#ifndef BOOST_PARAMETER_KEYWORD_HPP
|
||||
#define BOOST_PARAMETER_KEYWORD_HPP
|
||||
|
||||
#include <boost/parameter/aux_/unwrap_cv_reference.hpp>
|
||||
#include <boost/parameter/aux_/tag.hpp>
|
||||
#include <boost/parameter/aux_/default.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/parameter/keyword_fwd.hpp>
|
||||
#include <boost/parameter/config.hpp>
|
||||
|
||||
#if defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <utility>
|
||||
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#include <boost/mp11/integral.hpp>
|
||||
#include <boost/mp11/utility.hpp>
|
||||
#include <type_traits>
|
||||
#else
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
// Instances of unique specializations of keyword<...> serve to
|
||||
// associate arguments with parameter names. For example:
|
||||
//
|
||||
// struct rate_; // parameter names
|
||||
// struct skew_;
|
||||
// namespace
|
||||
// {
|
||||
// keyword<rate_> rate; // keywords
|
||||
// keyword<skew_> skew;
|
||||
// }
|
||||
//
|
||||
// ...
|
||||
//
|
||||
// f(rate = 1, skew = 2.4);
|
||||
//
|
||||
template <class Tag>
|
||||
struct keyword : noncopyable
|
||||
{
|
||||
template <class T>
|
||||
typename aux::tag<Tag, T>::type
|
||||
operator=(T& x) const
|
||||
// Instances of unique specializations of keyword<...> serve to
|
||||
// associate arguments with parameter names. For example:
|
||||
//
|
||||
// struct rate_; // parameter names
|
||||
// struct skew_;
|
||||
//
|
||||
// namespace
|
||||
// {
|
||||
// keyword<rate_> rate; // keywords
|
||||
// keyword<skew_> skew;
|
||||
// }
|
||||
//
|
||||
// ...
|
||||
//
|
||||
// f(rate = 1, skew = 2.4);
|
||||
template <typename Tag>
|
||||
struct keyword
|
||||
{
|
||||
typedef typename aux::tag<Tag, T>::type result;
|
||||
return result(x);
|
||||
}
|
||||
typedef Tag tag;
|
||||
|
||||
template <class Default>
|
||||
aux::default_<Tag, Default>
|
||||
operator|(Default& default_) const
|
||||
{
|
||||
return aux::default_<Tag, Default>(default_);
|
||||
}
|
||||
inline BOOST_CONSTEXPR keyword()
|
||||
{
|
||||
}
|
||||
|
||||
template <class Default>
|
||||
aux::lazy_default<Tag, Default>
|
||||
operator||(Default& default_) const
|
||||
{
|
||||
return aux::lazy_default<Tag, Default>(default_);
|
||||
}
|
||||
template <typename T>
|
||||
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_scalar<T>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::in_reference
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>
|
||||
>
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typename ::boost::mpl::eval_if<
|
||||
::boost::is_scalar<T>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::in_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
>
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, ::boost::parameter::aux::tag<Tag,T const&>
|
||||
>::type
|
||||
operator=(T const& x) const
|
||||
{
|
||||
typedef typename ::boost::parameter::aux
|
||||
::tag<Tag,T const&>::type result;
|
||||
return result(x);
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) // avoid partial ordering bugs
|
||||
template <class T>
|
||||
typename aux::tag<Tag, T const>::type
|
||||
operator=(T const& x) const
|
||||
{
|
||||
typedef typename aux::tag<Tag, T const>::type result;
|
||||
return result(x);
|
||||
}
|
||||
#endif
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR typename ::boost::enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_scalar<Default>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::in_reference
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>
|
||||
>
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typename ::boost::mpl::eval_if<
|
||||
::boost::is_scalar<Default>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::in_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
>
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, ::boost::parameter::aux::default_<Tag,Default const>
|
||||
>::type
|
||||
operator|(Default const& d) const
|
||||
{
|
||||
return ::boost::parameter::aux::default_<Tag,Default const>(d);
|
||||
}
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) // avoid partial ordering bugs
|
||||
template <class Default>
|
||||
aux::default_<Tag, const Default>
|
||||
operator|(const Default& default_) const
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
|
||||
volatile
|
||||
#endif
|
||||
{
|
||||
return aux::default_<Tag, const Default>(default_);
|
||||
}
|
||||
template <typename T>
|
||||
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_const<T>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
, ::boost::mp11::mp_false
|
||||
>
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typename ::boost::mpl::eval_if<
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>::type
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_const<T>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, ::boost::parameter::aux::tag<Tag,T&>
|
||||
>::type
|
||||
operator=(T& x) const
|
||||
{
|
||||
typedef typename ::boost::parameter::aux
|
||||
::tag<Tag,T&>::type result;
|
||||
return result(x);
|
||||
}
|
||||
|
||||
template <class Default>
|
||||
aux::lazy_default<Tag, Default>
|
||||
operator||(Default const& default_) const
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
|
||||
volatile
|
||||
#endif
|
||||
{
|
||||
return aux::lazy_default<Tag, Default>(default_);
|
||||
}
|
||||
#endif
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR typename ::boost::enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_const<Default>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_true
|
||||
>
|
||||
, ::boost::mp11::mp_false
|
||||
>
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typename ::boost::mpl::eval_if<
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>::type
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_const<Default>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, ::boost::parameter::aux::default_<Tag,Default>
|
||||
>::type
|
||||
operator|(Default& d) const
|
||||
{
|
||||
return ::boost::parameter::aux::default_<Tag,Default>(d);
|
||||
}
|
||||
|
||||
public: // Insurance against ODR violations
|
||||
|
||||
// People will need to define these keywords in header files. To
|
||||
// prevent ODR violations, it's important that the keyword used in
|
||||
// every instantiation of a function template is the same object.
|
||||
// We provide a reference to a common instance of each keyword
|
||||
// object and prevent construction by users.
|
||||
|
||||
static keyword<Tag>& get()
|
||||
{
|
||||
static keyword<Tag> result;
|
||||
return result;
|
||||
}
|
||||
|
||||
private:
|
||||
keyword() {}
|
||||
};
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR
|
||||
::boost::parameter::aux::lazy_default<Tag,Default const>
|
||||
operator||(Default const& d) const
|
||||
{
|
||||
return ::boost::parameter::aux
|
||||
::lazy_default<Tag,Default const>(d);
|
||||
}
|
||||
|
||||
// Reduces boilerplate required to declare and initialize keywords
|
||||
// without violating ODR. Declares a keyword tag type with the given
|
||||
// name in namespace tag_namespace, and declares and initializes a
|
||||
// reference in an anonymous namespace to a singleton instance of that
|
||||
// type.
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR
|
||||
::boost::parameter::aux::lazy_default<Tag,Default>
|
||||
operator||(Default& d) const
|
||||
{
|
||||
return ::boost::parameter::aux::lazy_default<Tag,Default>(d);
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
|
||||
template <typename T>
|
||||
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_scalar<T>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::in_reference
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>
|
||||
>
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typename ::boost::mpl::eval_if<
|
||||
::boost::is_scalar<T>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::in_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
>
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, ::boost::parameter::aux::tag<Tag,T const>
|
||||
>::type
|
||||
operator=(T const&& x) const
|
||||
{
|
||||
typedef typename ::boost::parameter::aux
|
||||
::tag<Tag,T const>::type result;
|
||||
return result(::std::forward<T const>(x));
|
||||
}
|
||||
|
||||
# define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \
|
||||
namespace tag_namespace { struct name; } \
|
||||
static ::boost::parameter::keyword<tag_namespace::name>& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::get();
|
||||
template <typename T>
|
||||
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_scalar<T>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::consume_reference
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>
|
||||
>
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typename ::boost::mpl::eval_if<
|
||||
::boost::is_scalar<T>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::consume_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
>
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, ::boost::parameter::aux::tag<Tag,T>
|
||||
>::type
|
||||
operator=(T&& x) const
|
||||
{
|
||||
typedef typename ::boost::parameter::aux::tag<Tag,T>::type result;
|
||||
return result(::std::forward<T>(x));
|
||||
}
|
||||
|
||||
#else
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR typename ::boost::enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_scalar<Default>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::in_reference
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>
|
||||
>
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typename ::boost::mpl::eval_if<
|
||||
::boost::is_scalar<Default>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::in_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
>
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, ::boost::parameter::aux::default_r_<Tag,Default const>
|
||||
>::type
|
||||
operator|(Default const&& d) const
|
||||
{
|
||||
return ::boost::parameter::aux::default_r_<Tag,Default const>(
|
||||
::std::forward<Default const>(d)
|
||||
);
|
||||
}
|
||||
|
||||
#define BOOST_PARAMETER_KEYWORD(tag_namespace,name) \
|
||||
namespace tag_namespace { struct name; } \
|
||||
namespace \
|
||||
{ \
|
||||
::boost::parameter::keyword<tag_namespace::name>& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::get(); \
|
||||
}
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR typename ::boost::enable_if<
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
::boost::mp11::mp_if<
|
||||
::std::is_scalar<Default>
|
||||
, ::boost::mp11::mp_false
|
||||
, ::boost::mp11::mp_if<
|
||||
::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::consume_reference
|
||||
>
|
||||
, ::boost::mp11::mp_true
|
||||
, ::std::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>
|
||||
>
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
typename ::boost::mpl::eval_if<
|
||||
::boost::is_scalar<Default>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::consume_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
>
|
||||
>::type
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
, ::boost::parameter::aux::default_r_<Tag,Default>
|
||||
>::type
|
||||
operator|(Default&& d) const
|
||||
{
|
||||
return ::boost::parameter::aux
|
||||
::default_r_<Tag,Default>(::std::forward<Default>(d));
|
||||
}
|
||||
|
||||
#endif
|
||||
public: // Insurance against ODR violations
|
||||
// Users will need to define their keywords in header files. To
|
||||
// prevent ODR violations, it's important that the keyword used in
|
||||
// every instantiation of a function template is the same object.
|
||||
// We provide a reference to a common instance of each keyword
|
||||
// object and prevent construction by users.
|
||||
static ::boost::parameter::keyword<Tag> const instance;
|
||||
|
||||
// This interface is deprecated.
|
||||
static ::boost::parameter::keyword<Tag>& get()
|
||||
{
|
||||
return const_cast< ::boost::parameter::keyword<Tag>&>(instance);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Tag>
|
||||
::boost::parameter::keyword<Tag> const ::boost::parameter
|
||||
::keyword<Tag>::instance = ::boost::parameter::keyword<Tag>();
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#endif // KEYWORD_050328_HPP
|
||||
#else // !defined(BOOST_PARAMETER_HAS_PERFECT_FORWARDING)
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE)
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/eval_if.hpp>
|
||||
#include <boost/core/enable_if.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#endif // BOOST_NO_SFINAE
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
// Instances of unique specializations of keyword<...> serve to
|
||||
// associate arguments with parameter names. For example:
|
||||
//
|
||||
// struct rate_; // parameter names
|
||||
// struct skew_;
|
||||
//
|
||||
// namespace
|
||||
// {
|
||||
// keyword<rate_> rate; // keywords
|
||||
// keyword<skew_> skew;
|
||||
// }
|
||||
//
|
||||
// ...
|
||||
//
|
||||
// f(rate = 1, skew = 2.4);
|
||||
template <typename Tag>
|
||||
struct keyword
|
||||
{
|
||||
typedef Tag tag;
|
||||
|
||||
inline BOOST_CONSTEXPR keyword()
|
||||
{
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
#if defined(BOOST_NO_SFINAE)
|
||||
inline typename ::boost::parameter::aux::tag<Tag,T const&>::type
|
||||
#else
|
||||
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
|
||||
typename ::boost::mpl::eval_if<
|
||||
::boost::is_scalar<T>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::in_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
>
|
||||
>::type
|
||||
, ::boost::parameter::aux::tag<Tag,T const&>
|
||||
>::type
|
||||
#endif // BOOST_NO_SFINAE
|
||||
operator=(T const& x) const
|
||||
{
|
||||
typedef typename ::boost::parameter::aux
|
||||
::tag<Tag,T const&>::type result;
|
||||
return result(x);
|
||||
}
|
||||
|
||||
template <typename Default>
|
||||
#if defined(BOOST_NO_SFINAE)
|
||||
inline ::boost::parameter::aux::default_<Tag,Default const>
|
||||
#else
|
||||
inline BOOST_CONSTEXPR typename ::boost::enable_if<
|
||||
typename ::boost::mpl::eval_if<
|
||||
::boost::is_scalar<Default>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::eval_if<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::in_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::mpl::false_
|
||||
>
|
||||
>
|
||||
>::type
|
||||
, ::boost::parameter::aux::default_<Tag,Default const>
|
||||
>::type
|
||||
#endif // BOOST_NO_SFINAE
|
||||
operator|(Default const& d) const
|
||||
{
|
||||
return ::boost::parameter::aux::default_<Tag,Default const>(d);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
#if defined(BOOST_NO_SFINAE)
|
||||
inline typename ::boost::parameter::aux::tag<Tag,T&>::type
|
||||
#else
|
||||
inline BOOST_CONSTEXPR typename ::boost::lazy_enable_if<
|
||||
typename ::boost::mpl::eval_if<
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>::type
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_const<T>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
, ::boost::parameter::aux::tag<Tag,T&>
|
||||
>::type
|
||||
#endif // BOOST_NO_SFINAE
|
||||
operator=(T& x) const
|
||||
{
|
||||
typedef typename ::boost::parameter::aux
|
||||
::tag<Tag,T&>::type result;
|
||||
return result(x);
|
||||
}
|
||||
|
||||
template <typename Default>
|
||||
#if defined(BOOST_NO_SFINAE)
|
||||
inline ::boost::parameter::aux::default_<Tag,Default>
|
||||
#else
|
||||
inline BOOST_CONSTEXPR typename ::boost::enable_if<
|
||||
typename ::boost::mpl::eval_if<
|
||||
typename ::boost::mpl::if_<
|
||||
::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::out_reference
|
||||
>
|
||||
, ::boost::mpl::true_
|
||||
, ::boost::is_same<
|
||||
typename Tag::qualifier
|
||||
, ::boost::parameter::forward_reference
|
||||
>
|
||||
>::type
|
||||
, ::boost::mpl::if_<
|
||||
::boost::is_const<Default>
|
||||
, ::boost::mpl::false_
|
||||
, ::boost::mpl::true_
|
||||
>
|
||||
, ::boost::mpl::false_
|
||||
>::type
|
||||
, ::boost::parameter::aux::default_<Tag,Default>
|
||||
>::type
|
||||
#endif // BOOST_NO_SFINAE
|
||||
operator|(Default& d) const
|
||||
{
|
||||
return ::boost::parameter::aux::default_<Tag,Default>(d);
|
||||
}
|
||||
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR
|
||||
::boost::parameter::aux::lazy_default<Tag,Default const>
|
||||
operator||(Default const& d) const
|
||||
{
|
||||
return ::boost::parameter::aux
|
||||
::lazy_default<Tag,Default const>(d);
|
||||
}
|
||||
|
||||
template <typename Default>
|
||||
inline BOOST_CONSTEXPR
|
||||
::boost::parameter::aux::lazy_default<Tag,Default>
|
||||
operator||(Default& d) const
|
||||
{
|
||||
return ::boost::parameter::aux::lazy_default<Tag,Default>(d);
|
||||
}
|
||||
|
||||
public: // Insurance against ODR violations
|
||||
// Users will need to define their keywords in header files. To
|
||||
// prevent ODR violations, it's important that the keyword used in
|
||||
// every instantiation of a function template is the same object.
|
||||
// We provide a reference to a common instance of each keyword
|
||||
// object and prevent construction by users.
|
||||
static ::boost::parameter::keyword<Tag> const instance;
|
||||
|
||||
// This interface is deprecated.
|
||||
static ::boost::parameter::keyword<Tag>& get()
|
||||
{
|
||||
return const_cast< ::boost::parameter::keyword<Tag>&>(instance);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename Tag>
|
||||
::boost::parameter::keyword<Tag> const ::boost::parameter
|
||||
::keyword<Tag>::instance = ::boost::parameter::keyword<Tag>();
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#endif // BOOST_PARAMETER_HAS_PERFECT_FORWARDING
|
||||
|
||||
#include <boost/parameter/aux_/name.hpp>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
|
||||
// Reduces boilerplate required to declare and initialize keywords without
|
||||
// violating ODR. Declares a keyword tag type with the given name in
|
||||
// namespace tag_namespace, and declares and initializes a reference in an
|
||||
// anonymous namespace to a singleton instance of that type.
|
||||
#if defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#define BOOST_PARAMETER_KEYWORD(tag_namespace, name) \
|
||||
namespace tag_namespace \
|
||||
{ \
|
||||
struct name \
|
||||
{ \
|
||||
static BOOST_CONSTEXPR char const* keyword_name() \
|
||||
{ \
|
||||
return BOOST_PP_STRINGIZE(name); \
|
||||
} \
|
||||
using _ = BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(name); \
|
||||
using _1 = _; \
|
||||
BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_BINDING(binding_fn, name); \
|
||||
BOOST_PARAMETER_TAG_MP11_PLACEHOLDER_VALUE(fn, name); \
|
||||
using qualifier = ::boost::parameter::forward_reference; \
|
||||
}; \
|
||||
} \
|
||||
namespace \
|
||||
{ \
|
||||
::boost::parameter::keyword<tag_namespace::name> const& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::instance; \
|
||||
}
|
||||
/**/
|
||||
#else // !defined(BOOST_PARAMETER_CAN_USE_MP11)
|
||||
#define BOOST_PARAMETER_KEYWORD(tag_namespace, name) \
|
||||
namespace tag_namespace \
|
||||
{ \
|
||||
struct name \
|
||||
{ \
|
||||
static BOOST_CONSTEXPR char const* keyword_name() \
|
||||
{ \
|
||||
return BOOST_PP_STRINGIZE(name); \
|
||||
} \
|
||||
typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(name) _; \
|
||||
typedef BOOST_PARAMETER_TAG_PLACEHOLDER_TYPE(name) _1; \
|
||||
typedef ::boost::parameter::forward_reference qualifier; \
|
||||
}; \
|
||||
} \
|
||||
namespace \
|
||||
{ \
|
||||
::boost::parameter::keyword<tag_namespace::name> const& name \
|
||||
= ::boost::parameter::keyword<tag_namespace::name>::instance; \
|
||||
}
|
||||
/**/
|
||||
#endif // BOOST_PARAMETER_CAN_USE_MP11
|
||||
|
||||
#endif // include guard
|
||||
|
||||
|
||||
23
include/boost/parameter/keyword_fwd.hpp
Normal file
23
include/boost/parameter/keyword_fwd.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
// Copyright Cromwell D. Enage 2017.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef BOOST_PARAMETER_KEYWORD_FWD_HPP
|
||||
#define BOOST_PARAMETER_KEYWORD_FWD_HPP
|
||||
|
||||
namespace boost { namespace parameter {
|
||||
|
||||
struct in_reference;
|
||||
struct out_reference;
|
||||
typedef ::boost::parameter::out_reference in_out_reference;
|
||||
struct forward_reference;
|
||||
struct consume_reference;
|
||||
typedef ::boost::parameter::consume_reference move_from_reference;
|
||||
|
||||
template <typename Tag>
|
||||
struct keyword;
|
||||
}} // namespace boost::parameter
|
||||
|
||||
#endif // include guard
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user