mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-06-29 22:11:04 +02:00
Compare commits
76 Commits
boost-1.65
...
boost-1.73
Author | SHA1 | Date | |
---|---|---|---|
e4fb5f4866 | |||
9cf66925d4 | |||
e4ce0f06f5 | |||
98f6c75e1e | |||
f99ed9921a | |||
a378d239da | |||
0332a793f5 | |||
6c350c6fc3 | |||
728c71ba75 | |||
1ab9385a91 | |||
688c3f2ee6 | |||
bd0db5ce8b | |||
da60e76913 | |||
661dd91603 | |||
ffb27a1d56 | |||
a6404a8fb2 | |||
732d00341f | |||
e7256313c4 | |||
b3036f1a63 | |||
de49676452 | |||
4f4f04c56b | |||
c5e90f23b7 | |||
776037ae56 | |||
a9827c8fc8 | |||
6db241a78d | |||
4fe7807f79 | |||
80107ea60a | |||
1473215dc7 | |||
291f92696d | |||
771edacbff | |||
ac99242b71 | |||
bda6ad9148 | |||
88a0365f4d | |||
6af29d8b77 | |||
af70b2872e | |||
b7b1425c7f | |||
54669af127 | |||
e439b2555e | |||
4cce94a84e | |||
2f9be1086a | |||
684e9991ec | |||
a42f374b97 | |||
0cdd09e6e1 | |||
22deb165b6 | |||
e476f10f52 | |||
c436de6142 | |||
5756fb08ad | |||
9b3e6a2cd6 | |||
d135cad759 | |||
8d26689387 | |||
f78f0a1d25 | |||
87fd89a7db | |||
adf2746626 | |||
fe70754559 | |||
45588469f3 | |||
344ce6abf9 | |||
31653b34c9 | |||
a4e304ca87 | |||
0e335df79e | |||
ee5ed2510d | |||
dd44e1eea5 | |||
b5c081bf7a | |||
347f48afae | |||
49a72ac4f2 | |||
56090c56b5 | |||
00b2f44624 | |||
a329a67b47 | |||
34af3a925c | |||
ad22f9686e | |||
39175c471f | |||
aa9ee3ae3f | |||
50ffeeee8b | |||
f54e270433 | |||
08ec2abb2e | |||
c4b1ce10bd | |||
1ecc2e2ec9 |
314
.travis.yml
314
.travis.yml
@ -1,38 +1,322 @@
|
||||
# Copyright 2016 Edward Diener
|
||||
# Copyright 2016-2019 Peter Dimov
|
||||
# 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)
|
||||
|
||||
language: cpp
|
||||
|
||||
sudo: false
|
||||
|
||||
python: "2.7"
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
dist: xenial
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /feature\/.*/
|
||||
|
||||
env:
|
||||
matrix:
|
||||
- BOGUS_JOB=true
|
||||
|
||||
matrix:
|
||||
|
||||
exclude:
|
||||
- env: BOGUS_JOB=true
|
||||
|
||||
include:
|
||||
- os: linux
|
||||
compiler: g++
|
||||
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.4
|
||||
env: TOOLSET=gcc COMPILER=g++-4.4 CXXSTD=98
|
||||
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
|
||||
compiler: g++-4.7
|
||||
env: TOOLSET=gcc COMPILER=g++-4.7 CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-4.8
|
||||
env: TOOLSET=gcc COMPILER=g++-4.8 CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- os: linux
|
||||
compiler: g++-4.9
|
||||
env: TOOLSET=gcc COMPILER=g++-4.9 CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-4.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-5
|
||||
env: TOOLSET=gcc COMPILER=g++-5 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-6
|
||||
env: TOOLSET=gcc COMPILER=g++-6 CXXSTD=03,11,14,1z
|
||||
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
|
||||
compiler: g++-8
|
||||
env: TOOLSET=gcc COMPILER=g++-8 CXXSTD=03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: g++-9
|
||||
env: TOOLSET=gcc COMPILER=g++-9 CXXSTD=03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: /usr/bin/clang++
|
||||
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.3
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: /usr/bin/clang++
|
||||
env: TOOLSET=clang COMPILER=/usr/bin/clang++ CXXSTD=03,11
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.4
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.5
|
||||
env: TOOLSET=clang COMPILER=clang++-3.5 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.5
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.6
|
||||
env: TOOLSET=clang COMPILER=clang++-3.6 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.6
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.7
|
||||
env: TOOLSET=clang COMPILER=clang++-3.7 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.8
|
||||
env: TOOLSET=clang COMPILER=clang++-3.8 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-3.9
|
||||
env: TOOLSET=clang COMPILER=clang++-3.9 CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-3.9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- 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
|
||||
|
||||
- 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
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-6.0
|
||||
env: TOOLSET=clang COMPILER=clang++-6.0 CXXSTD=03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-6.0
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-7
|
||||
env: TOOLSET=clang COMPILER=clang++-7 CXXSTD=03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-7
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-xenial-7
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-8
|
||||
env: TOOLSET=clang COMPILER=clang++-8 CXXSTD=03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-8
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- llvm-toolchain-xenial-8
|
||||
|
||||
- os: linux
|
||||
compiler: clang++-9
|
||||
env: TOOLSET=clang COMPILER=clang++-9 CXXSTD=03,11,14,17,2a
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- clang-9
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
- sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
|
||||
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
|
||||
|
||||
- os: linux
|
||||
dist: trusty
|
||||
compiler: clang++-libc++
|
||||
env: TOOLSET=clang COMPILER=clang++-libc++ CXXSTD=03,11,14,1z
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libc++-dev
|
||||
|
||||
- os: osx
|
||||
compiler: clang++
|
||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
|
||||
|
||||
- os: linux
|
||||
env: CMAKE_TEST=1
|
||||
script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=preprocessor ..
|
||||
- ctest --output-on-failure -R boost_preprocessor
|
||||
|
||||
- os: linux
|
||||
env: CMAKE_SUBDIR_TEST=1
|
||||
install: true
|
||||
script:
|
||||
- cd test/cmake_subdir_test && mkdir __build__ && cd __build__
|
||||
- cmake ..
|
||||
- cmake --build .
|
||||
- cmake --build . --target check
|
||||
|
||||
- os: linux
|
||||
env: CMAKE_INSTALL_TEST=1
|
||||
script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=preprocessor -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||
- cmake --build . --target install
|
||||
- cd ../libs/preprocessor/test/cmake_install_test && mkdir __build__ && cd __build__
|
||||
- cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||
- cmake --build .
|
||||
- cmake --build . --target check
|
||||
|
||||
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
|
||||
- git clone -b $BOOST_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init --depth 1 tools/build
|
||||
- git submodule update --init --depth 1 libs/config
|
||||
- git submodule update --init --depth 1 tools/boostdep
|
||||
- git submodule update --init tools/boostdep
|
||||
- cp -r $TRAVIS_BUILD_DIR/* libs/preprocessor
|
||||
- python tools/boostdep/depinst/depinst.py preprocessor
|
||||
- ./bootstrap.sh
|
||||
- ./b2 headers
|
||||
|
||||
script:
|
||||
- TOOLSET=gcc,clang
|
||||
- if [ $TRAVIS_OS_NAME == osx ]; then TOOLSET=clang; fi
|
||||
- ./b2 libs/preprocessor/test toolset=$TOOLSET
|
||||
- |-
|
||||
echo "using $TOOLSET : : $COMPILER ;" > ~/user-config.jam
|
||||
- ./b2 -j 3 libs/preprocessor/test toolset=$TOOLSET cxxstd=$CXXSTD
|
||||
|
||||
notifications:
|
||||
email:
|
||||
|
25
CMakeLists.txt
Normal file
25
CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
||||
# Copyright 2019 Peter Dimov
|
||||
# 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
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(boost_preprocessor VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||
|
||||
add_library(boost_preprocessor INTERFACE)
|
||||
add_library(Boost::preprocessor ALIAS boost_preprocessor)
|
||||
|
||||
target_include_directories(boost_preprocessor INTERFACE include)
|
||||
|
||||
if(BOOST_SUPERPROJECT_VERSION)
|
||||
|
||||
include(BoostInstall)
|
||||
boost_install(TARGETS boost_preprocessor HEADER_DIRECTORY include/)
|
||||
|
||||
endif()
|
||||
|
||||
if(BUILD_TESTING)
|
||||
|
||||
add_subdirectory(test)
|
||||
|
||||
endif()
|
95
appveyor.yml
Normal file
95
appveyor.yml
Normal file
@ -0,0 +1,95 @@
|
||||
# Copyright 2017 Edward Diener
|
||||
# Copyright 2018 Mike Dev
|
||||
# Copyright 2019 Peter Dimov
|
||||
# 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
|
||||
|
||||
configuration:
|
||||
- boost_build_test
|
||||
- cmake_test
|
||||
- cmake_subdir_test
|
||||
- cmake_install_test
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
- /feature\/.*/
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
TOOLSET: msvc-9.0,msvc-10.0,msvc-11.0,msvc-12.0,msvc-14.0
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
TOOLSET: msvc-14.1
|
||||
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
||||
TOOLSET: msvc-14.2
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
- configuration: cmake_test
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
|
||||
- configuration: cmake_test
|
||||
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
||||
|
||||
build: off
|
||||
|
||||
install:
|
||||
- set BOOST_BRANCH=develop
|
||||
- if "%APPVEYOR_REPO_BRANCH%" == "master" set BOOST_BRANCH=master
|
||||
- cd ..
|
||||
- git clone -b %BOOST_BRANCH% --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/boostdep
|
||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\preprocessor\
|
||||
- python tools/boostdep/depinst/depinst.py preprocessor
|
||||
|
||||
for:
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- configuration: boost_build_test
|
||||
|
||||
test_script:
|
||||
- bootstrap
|
||||
- b2 -d0 headers
|
||||
- b2 -j3 libs/preprocessor/test toolset=%TOOLSET%
|
||||
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- configuration: cmake_test
|
||||
|
||||
test_script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=preprocessor ..
|
||||
- ctest --output-on-failure -R boost_preprocessor -C Debug
|
||||
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- configuration: cmake_subdir_test
|
||||
|
||||
test_script:
|
||||
- cd libs/preprocessor/test/cmake_subdir_test && mkdir __build__ && cd __build__
|
||||
- cmake ..
|
||||
- cmake --build .
|
||||
- cmake --build . --target check
|
||||
|
||||
-
|
||||
matrix:
|
||||
only:
|
||||
- configuration: cmake_install_test
|
||||
|
||||
test_script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=preprocessor -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
|
||||
- cmake --build . --target install
|
||||
- cd ../libs/preprocessor/test/cmake_install_test && mkdir __build__ && cd __build__
|
||||
- cmake -DCMAKE_INSTALL_PREFIX=C:/cmake-prefix ..
|
||||
- cmake --build .
|
||||
- cmake --build . --target check
|
@ -80,12 +80,16 @@
|
||||
<li><a href="headers/facilities.html">facilities.hpp</a></li>
|
||||
<li>facilities/</li>
|
||||
<li class="ps"><a href="headers/facilities/apply.html">apply.hpp</a></li>
|
||||
<li class="ps"><a href="headers/facilities/check_empty.html">check_empty.hpp</a>
|
||||
<a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
<li class="ps"><a href="headers/facilities/empty.html">empty.hpp</a></li>
|
||||
<li class="ps"><a href="headers/facilities/expand.html">expand.hpp</a></li>
|
||||
<li class="ps"><a href="headers/facilities/identity.html">identity.hpp</a></li>
|
||||
<li class="ps"><a href="headers/facilities/intercept.html">intercept.hpp</a></li>
|
||||
<li class="ps"><a href="headers/facilities/overload.html">overload.hpp</a>
|
||||
<a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
<li class="ps"><a href="headers/facilities/va_opt.html">va_opt.hpp</a>
|
||||
<a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
<li><a href="headers/for.html">for.hpp*</a></li>
|
||||
<li><a href="headers/identity.html">identity.hpp*</a></li>
|
||||
<li><a href="headers/if.html">if.hpp*</a></li>
|
||||
@ -230,6 +234,7 @@
|
||||
<li><a href="headers/variadic.html">variadic.hpp</a></li>
|
||||
<li>variadic/</li>
|
||||
<li class="ps"><a href="headers/variadic/elem.html">elem.hpp</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
<li class="ps"><a href="headers/variadic/has_opt.html">has_opt.hpp</a> </li>
|
||||
<li class="ps"><a href="headers/variadic/size.html">size.hpp</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
<li class="ps"><a href="headers/variadic/to_array.html">to_array.hpp</a> <a
|
||||
href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
|
@ -15,6 +15,7 @@
|
||||
<ul>
|
||||
<li><a href="facilities/apply.html"><boost/preprocessor/facilities/apply.hpp></a></li>
|
||||
<li><a href="facilities/empty.html"><boost/preprocessor/facilities/empty.hpp></a></li>
|
||||
<li><a href="facilities/check_empty.html"><boost/preprocessor/facilities/check_empty.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
||||
<li><a href="facilities/expand.html"><boost/preprocessor/facilities/expand.hpp></a></li>
|
||||
<li><a href="facilities/identity.html"><boost/preprocessor/facilities/identity.hpp></a></li>
|
||||
<li><a href="facilities/intercept.html"><boost/preprocessor/facilities/intercept.hpp></a></li>
|
||||
|
29
doc/headers/facilities/check_empty.html
Normal file
29
doc/headers/facilities/check_empty.html
Normal file
@ -0,0 +1,29 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>facilities/check_empty.hpp</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>facilities/check_empty.hpp</b> header defines a variadic macro for the C++20 level that checks if its data is empty or not.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#include <b><boost/preprocessor/facilities/check_empty.hpp></b>
|
||||
</div>
|
||||
<h4>Contents</h4>
|
||||
<ul>
|
||||
<li><a href="../../ref/check_empty.html">BOOST_PP_CHECK_EMPTY</a> <a href="../../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;">
|
||||
<i></i><i><EFBFBD> Copyright Edward Diener 2019</i>
|
||||
</div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file <a href="../../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
|
||||
copy at <a href=
|
||||
"http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
32
doc/headers/facilities/va_opt.html
Normal file
32
doc/headers/facilities/va_opt.html
Normal file
@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;
|
||||
charset=windows-1252">
|
||||
<title>facilities/va_opt.hpp</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;"> The <b>facilities/va_opt.hpp</b>
|
||||
header defines a variadic macro for the C++20 level that offers a
|
||||
more flexible alternative to the __VA_OPT__ construct. </div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code"> #include <b><boost/preprocessor/facilities/va_opt.hpp></b>
|
||||
</div>
|
||||
<h4>Contents</h4>
|
||||
<ul>
|
||||
<li><a href="../../ref/va_opt.html">BOOST_PP_VA_OPT</a> <a
|
||||
href="../../topics/variadic_macros.html#VNotation"
|
||||
target="_self">(v)</a></li>
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i><EFBFBD> Copyright Edward Diener 2019</i>
|
||||
</div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version
|
||||
1.0. (See accompanying file <a
|
||||
href="../../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
|
||||
copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -14,6 +14,7 @@
|
||||
<h4>Includes</h4>
|
||||
<ul>
|
||||
<li><a href="variadic/elem.html"><boost/preprocessor/variadic/elem.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
||||
<li><a href="variadic/has_opt.html"><boost/preprocessor/variadic/has_opt.hpp></a> </li>
|
||||
<li><a href="variadic/size.html"><boost/preprocessor/variadic/size.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
||||
<li><a href="variadic/to_array.html"><boost/preprocessor/variadic/to_array.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
||||
<li><a href="variadic/to_list.html"><boost/preprocessor/variadic/to_list.hpp></a> <a href="../topics/variadic_macros.html#VNotation" target="_self">(v)</a></li>
|
||||
@ -22,7 +23,7 @@
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;">
|
||||
<i></i><i><EFBFBD> Copyright Edward Diener 2011,2013</i>
|
||||
<i></i><i><EFBFBD> Copyright Edward Diener 2011,2013,2019</i>
|
||||
</div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
25
doc/headers/variadic/has_opt.html
Normal file
25
doc/headers/variadic/has_opt.html
Normal file
@ -0,0 +1,25 @@
|
||||
<html><head>
|
||||
<title>variadic/has_opt.hpp</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../styles.css"></head><body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>variadic/has_opt.hpp</b> header defines a macro that determines whether or not the __VA_OPT__ construct is supported.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#include <b><boost/preprocessor/variadic/has_opt.hpp></b>
|
||||
</div>
|
||||
<h4>Contents</h4>
|
||||
<ul>
|
||||
<li><a href="../../ref/variadic_has_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a> <br>
|
||||
</li>
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;">
|
||||
<i></i><i><EFBFBD> Copyright Edward Diener 2019</i>
|
||||
</div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file <a href="../../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
|
||||
copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||
</div>
|
||||
</body></html>
|
@ -45,6 +45,7 @@
|
||||
<li><a href="ref/bool.html">BOOL</a></li>
|
||||
<!-- C -->
|
||||
<li><a href="ref/cat.html">CAT</a></li>
|
||||
<li><a href="ref/check_empty.html">CHECK_EMPTY</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
<li><a href="ref/comma.html">COMMA</a></li>
|
||||
<li><a href="ref/comma_if.html">COMMA_IF</a></li>
|
||||
<li><a href="ref/compl.html">COMPL</a></li>
|
||||
@ -295,9 +296,11 @@
|
||||
<!-- U -->
|
||||
<li><a href="ref/update_counter.html">UPDATE_COUNTER</a></li>
|
||||
<!-- V -->
|
||||
<li><a href="ref/va_opt.html">VA_OPT</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
<li><a href="ref/value.html">VALUE</a></li>
|
||||
<li><a href="ref/variadics.html">VARIADICS</a></li>
|
||||
<li><a href="ref/variadic_elem.html">VARIADIC_ELEM</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
<li><a href="ref/variadic_has_opt.html">VARIADIC_HAS_OPT</a></li>
|
||||
<li><a href="ref/variadic_seq_to_seq.html">VARIADIC_SEQ_TO_SEQ</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
<li><a href="ref/variadic_size.html">VARIADIC_SIZE</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
<li><a href="ref/variadic_to_array.html">VARIADIC_TO_ARRAY</a> <a href="topics/variadic_macros.html#VNotation">(v)</a></li>
|
||||
|
68
doc/ref/check_empty.html
Normal file
68
doc/ref/check_empty.html
Normal file
@ -0,0 +1,68 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_CHECK_EMPTY</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;"> The <b>BOOST_PP_CHECK_EMPTY</b> variadic macro
|
||||
checks to see if its variadic input is empty or not. It expands to 1 if its input
|
||||
is empty and expands to 0 if its input is not empty. The macro only exists when
|
||||
the compilation is at the C++20 level and the __VA_OPT__ construct is supported.</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code"> <b>BOOST_PP_CHECK_EMPTY</b>(<i>...</i>) <a href="../topics/variadic_macros.html#VNotation" target="_self"><sup>(v)</sup></a><br>
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>...<br>
|
||||
</dt>
|
||||
<dd> The <i>variadic data</i> to be checked for emptiness. </dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
When the macro invocation BOOST_PP_VARIADIC_HAS_OPT() expands to 1, then this
|
||||
macro exists and can be invoked, otherwise this macro does not exist
|
||||
and attempting to invoke it will lead to a preprocessor error that the macro
|
||||
can not be found. Because of this condition the header file for including
|
||||
this macro includes the header file for the BOOST_PP_VARIADIC_HAS_OPT macro.<br>
|
||||
It is possible to pass data to this macro which expands to nothing, in which
|
||||
case this macro will expand to 1 just as if nothing has been passed.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="variadic_has_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div> <b>Header:</b> <a href="../headers/facilities/check_empty.html"><boost/preprocessor/facilities/check_empty.hpp></a>
|
||||
</div>
|
||||
<h4>Sample Code</h4>
|
||||
<div>
|
||||
<pre>
|
||||
#include <<a href="../headers/facilities/check_empty.html">boost/preprocessor/facilities/check_empty.hpp</a>>
|
||||
|
||||
# if <a href="variadic_has_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a>()
|
||||
|
||||
#define DATA
|
||||
#define OBJECT OBJECT2
|
||||
#define OBJECT2
|
||||
#define FUNC(x) FUNC2(x)
|
||||
#define FUNC2(x)
|
||||
#define FUNC_GEN(x,y) (1,2,3)
|
||||
|
||||
<a href="check_empty.html">BOOST_PP_CHECK_EMPTY</a>(DATA) // expands to 1
|
||||
<a href="check_empty.html">BOOST_PP_CHECK_EMPTY</a>(OBJECT) // expands to 1
|
||||
<a href="check_empty.html">BOOST_PP_CHECK_EMPTY</a>(FUNC(1)) // expands to 1
|
||||
<a href="check_empty.html">BOOST_PP_CHECK_EMPTY</a>(FUNC) // expands to 0
|
||||
<a href="check_empty.html">BOOST_PP_CHECK_EMPTY</a>(FUNC_GEN) // expands to 0
|
||||
|
||||
#endif
|
||||
</pre>
|
||||
</div>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i></i><i><EFBFBD> Copyright Edward Diener 2019</i> </div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
|
||||
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -22,7 +22,7 @@
|
||||
<div>
|
||||
This macro is useful when a delay is necessary to produce the correct semantics of a macro invocation.
|
||||
For example, when a macro expands to an argument list to another macro.
|
||||
This macro will expand the the argument list on the first pass, and then rescan to expand any more macros.
|
||||
This macro will expand the argument list on the first pass, and then rescan to expand any more macros.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
|
@ -33,7 +33,7 @@
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/facilities/identity_n.html"><boost/preprocessor/facilities/identity.hpp></a>
|
||||
<b>Header:</b> <a href="../headers/facilities/identity.html"><boost/preprocessor/facilities/identity.hpp></a>
|
||||
</div>
|
||||
<h4>Sample Code</h4>
|
||||
<div><pre>
|
||||
|
@ -30,5 +30,13 @@
|
||||
<h4> Requirements </h4>
|
||||
<div> <b>Header:</b> <a href="../headers/list/to_array.html"><boost/preprocessor/list/to_array.hpp></a>
|
||||
</div>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i></i><i>© Copyright Edward Diener 2011</i>
|
||||
</div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
|
||||
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -28,5 +28,12 @@
|
||||
<h4> Requirements </h4>
|
||||
<div> <b>Header:</b> <a href="../headers/list/to_seq.html"><boost/preprocessor/list/to_seq.hpp></a>
|
||||
</div>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i>© Copyright Edward Diener 2011</i> </div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version 1.0. (See
|
||||
accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
|
||||
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -42,7 +42,7 @@ not occur.<br>
|
||||
<b>Header:</b> <a href="../headers/tuple/eat.html"><boost/preprocessor/tuple/eat.hpp></a>
|
||||
</div>
|
||||
<h4>Sample Code</h4>
|
||||
<div><pre>#include <<a href="../headers/control/if.html">boost/preprocessor/control/if.hpp</a>><br>#include <<a href="../headers/tuple/eat.html">boost/preprocessor/tuple/eat.hpp</a>><br><br>#define OP(a, b) (a b)<br><br>#define MACRO(n) <a href="if.html">BOOST_PP_IF</a>(n, OP, <a href="tuple_eat.html">BOOST_PP_TUPLE_EAT</a>(2))(1, 2)<br><br>// or for the variadic version <a href="../topics/variadic_macros.html#VNotation" target="_self"><sup>(v)</sup></a><br><br>#define MACRO(n) <a href="if.html">BOOST_PP_IF</a>(n, OP, <a href="file:///C:/Programming/VersionControl/sandbox/variadics/libs/preprocessor/doc/ref/tuple_eat.html">BOOST_PP_TUPLE_EAT</a>())(1, 2)<br><br>MACRO(0) // expands to nothing<br>MACRO(1) // expands to (1, 2)<br></pre></div>
|
||||
<div><pre>#include <<a href="../headers/control/if.html">boost/preprocessor/control/if.hpp</a>><br>#include <<a href="../headers/tuple/eat.html">boost/preprocessor/tuple/eat.hpp</a>><br><br>#define OP(a, b) (a b)<br><br>#define MACRO(n) <a href="if.html">BOOST_PP_IF</a>(n, OP, <a href="tuple_eat.html">BOOST_PP_TUPLE_EAT</a>(2))(1, 2)<br><br>// or for the variadic version <a href="../topics/variadic_macros.html#VNotation" target="_self"><sup>(v)</sup></a><br><br>#define MACRO(n) <a href="if.html">BOOST_PP_IF</a>(n, OP, <a href="tuple_eat.html">BOOST_PP_TUPLE_EAT</a>())(1, 2)<br><br>MACRO(0) // expands to nothing<br>MACRO(1) // expands to (1, 2)<br></pre></div>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;">
|
||||
<i><EFBFBD> Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
|
||||
|
@ -49,7 +49,7 @@ or<br>
|
||||
<b>Header:</b> <a href="../headers/tuple/elem.html"><boost/preprocessor/tuple/elem.hpp></a>
|
||||
</div>
|
||||
<h4>Sample Code</h4>
|
||||
<div><pre>#include <<a href="../headers/tuple/elem.html">boost/preprocessor/tuple/elem.hpp</a>><br><br>#define TUPLE (a, b, c, d)<br><br><a href="tuple_elem.html">BOOST_PP_TUPLE_ELEM</a>(4, 0, TUPLE) // expands to a<br><a href="tuple_elem.html">BOOST_PP_TUPLE_ELEM</a>(4, 3, TUPLE) // expands to d<br><br>// or for the variadic version <a href="../topics/variadic_macros.html#VNotation" target="_self"><sup>(v)</sup></a><br><br><a href="file:///C:/Programming/VersionControl/sandbox/variadics/libs/preprocessor/doc/ref/tuple_elem.html">BOOST_PP_TUPLE_ELEM</a>(0, TUPLE) // expands to a in the variadic version<br><a href="file:///C:/Programming/VersionControl/sandbox/variadics/libs/preprocessor/doc/ref/tuple_elem.html">BOOST_PP_TUPLE_ELEM</a>(3, TUPLE) // expands to d in the variadic version<br></pre></div>
|
||||
<div><pre>#include <<a href="../headers/tuple/elem.html">boost/preprocessor/tuple/elem.hpp</a>><br><br>#define TUPLE (a, b, c, d)<br><br><a href="tuple_elem.html">BOOST_PP_TUPLE_ELEM</a>(4, 0, TUPLE) // expands to a<br><a href="tuple_elem.html">BOOST_PP_TUPLE_ELEM</a>(4, 3, TUPLE) // expands to d<br><br>// or for the variadic version <a href="../topics/variadic_macros.html#VNotation" target="_self"><sup>(v)</sup></a><br><br><a href="tuple_elem.html">BOOST_PP_TUPLE_ELEM</a>(0, TUPLE) // expands to a in the variadic version<br><a href="tuple_elem.html">BOOST_PP_TUPLE_ELEM</a>(3, TUPLE) // expands to d in the variadic version<br></pre></div>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;">
|
||||
<i><EFBFBD> Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
|
||||
|
124
doc/ref/va_opt.html
Normal file
124
doc/ref/va_opt.html
Normal file
@ -0,0 +1,124 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html;
|
||||
charset=windows-1252">
|
||||
<title>BOOST_PP_VA_OPT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;"> The <b>BOOST_PP_VA_OPT</b> variadic
|
||||
macro is a more flexible alternative to the C++20 __VA_OPT__
|
||||
construct. It expands to either one of two inputs depending on
|
||||
whether the variadic data is empty or not, whereas the C++20
|
||||
__VA_OPT__ constructs expands to either its input or nothing
|
||||
depending on whether the variadic data is empty or not. This macro
|
||||
only exists when the compilation is at the C++20 level and the
|
||||
__VA_OPT__ construct is supported.</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code"> <b>BOOST_PP_VA_OPT</b>(x,y,<i>...</i>) <a
|
||||
href="../topics/variadic_macros.html#VNotation" target="_self"><sup>(v)</sup></a><br>
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<p> x<br>
|
||||
A tuple
|
||||
whose data is the macro expansion if the <i>variadic data</i> is
|
||||
<b>not</b> empty<br>
|
||||
y<br>
|
||||
A tuple
|
||||
whose data is the macro expansion if the <i>variadic data</i> is
|
||||
empty<br>
|
||||
,,,<br>
|
||||
The <i>variadic
|
||||
data</i> to be checked for emptiness<br>
|
||||
</p>
|
||||
<dl>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div> When the macro invocation BOOST_PP_VARIADIC_HAS_OPT() expands
|
||||
to 1, then this macro exists and can be invoked, otherwise this
|
||||
macro does not exist and attempting to invoke it will lead to a
|
||||
preprocessor error that the macro can not be found. Because of
|
||||
this condition the header file for including this macro includes
|
||||
the header file for the BOOST_PP_VARIADIC_HAS_OPT macro.<br>
|
||||
<br>
|
||||
The difference between this macro and the __VA_OPT__ construct
|
||||
illustrates a limitation of the latter construct with a trade off
|
||||
of simpler syntax. The differences between the __VA_OPT__
|
||||
construct and this macro are:<br>
|
||||
<ul>
|
||||
<li>The __VA_OPT__ construct offers a choice as its expansion
|
||||
only between its input preprocessing tokens or nothing (
|
||||
called a "single placemarker token" ) depending on whether the
|
||||
implicit variadic data is empty or not. There is no way using
|
||||
the __VA_OPT__ construct to specify any alternative but the
|
||||
"single placemarker token" when the variadic data is empty
|
||||
whereas any preprocessing tokens can be specified when the
|
||||
variadic data is not empty. With the BOOST_PP_VA_OPT macro the
|
||||
user can specify as its expansion preprocessing tokens both
|
||||
when the variadic data is empty and when the variadic data is
|
||||
not empty.</li>
|
||||
<li>The __VA_OPT__ construct offers a simple syntax whereas this
|
||||
macro is more verbose. The BOOST_PP_VA_OPT macro's first and
|
||||
second parameters must be Boost PP tuples of data, in order to
|
||||
expand to normal or variadic data, and the third parameter
|
||||
must be the variadic data to check for emptiness, whereas the
|
||||
__VA_OPT__ construct has an implied variadic data as
|
||||
__VA_ARGS__ to check for emptiness and can specify its
|
||||
expansion directly in terms of its input.</li>
|
||||
<li>The __VA_OPT__ construct can only be specified in the
|
||||
replacement list of some macro, whereas the BOOST_PP_VA_OPT
|
||||
macro can be used both as an alternative to the __VA_OPT__
|
||||
construct in the replacement list of some macro and anywhere
|
||||
else a macro can be used.</li>
|
||||
<li>It is impossible to have a left parenthesis '(' or a right
|
||||
parenthesis ')' as preprocessing token data within the
|
||||
__VA_OPT__ construct whereas both are possible as part of the
|
||||
expanded data for the BOOST_PP_VA_OPT macro.<br>
|
||||
</li>
|
||||
</ul>
|
||||
<br>
|
||||
The exact BOOST_PP_VA_OPT equivalent to the construct of
|
||||
'__VA_OPT__ ( pp-tokens )' in the replacement list of a macro is
|
||||
'BOOST_PP_VA_OPT (( pp-tokens ),(),__VA_ARGS__)'.</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="variadic_has_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div> <b>Header:</b> <a
|
||||
href="../headers/facilities/va_opt.html"><boost/preprocessor/facilities/va_opt.hpp></a>
|
||||
</div>
|
||||
<h4>Sample Code</h4>
|
||||
<div>
|
||||
<pre>#include <<a href="../headers/facilities/va_opt.html">boost/preprocessor/facilities/va_opt.hpp</a>>
|
||||
|
||||
# if <a href="variadic_has_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a>()
|
||||
|
||||
#define DATA
|
||||
#define OBJECT OBJECT2
|
||||
#define OBJECT2
|
||||
#define FUNC(x) FUNC2(x)
|
||||
#define FUNC2(x)
|
||||
#define FUNC_GEN(x,y) (1,2,3)
|
||||
|
||||
<a href="va_opt.html">BOOST_PP_VA_OPT</a>((1),(2),DATA) // expands to 2
|
||||
<a href="va_opt.html">BOOST_PP_VA_OPT</a>((3),(4),OBJECT) // expands to 4
|
||||
<a href="va_opt.html">BOOST_PP_VA_OPT</a>((5),(6),FUNC(1)) // expands to 6
|
||||
<a href="va_opt.html">BOOST_PP_VA_OPT</a>((7,8),(9,10),FUNC) // expands to 7,8
|
||||
<a href="va_opt.html">BOOST_PP_VA_OPT</a>((1,2,3,4,5),(6,7,8,9,10),FUNC_GEN) // expands to 1,2,3,4,5
|
||||
|
||||
#endif
|
||||
</pre>
|
||||
</div>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i><EFBFBD> Copyright Edward Diener 2019</i>
|
||||
</div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version
|
||||
1.0. (See accompanying file <a
|
||||
href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
|
||||
copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
63
doc/ref/variadic_has_opt.html
Normal file
63
doc/ref/variadic_has_opt.html
Normal file
@ -0,0 +1,63 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_VARIADIC_HAS_OPT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;"> The <b>BOOST_PP_VARIADIC_HAS_OPT</b> macro
|
||||
determines whether or not the C++20 __VA_OPT__ construct is supported for the compiler's preprocessor being used.
|
||||
Expands to 1 if the __VA_OPT__ construct is supported, otherwise expands to 0.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code"> <b>BOOST_PP_VARIADIC_HAS_OPT</b>() <br>
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>None<br>
|
||||
</dt>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro only returns 1 if the compiler is compiling at its own C++20 level and
|
||||
__VA_OPT__ is supported. It is possible for a compiler to support the __VA_OPT__
|
||||
construct when not compiling at its own C++20 level, but this macro will return
|
||||
0 in that case even if __VA_OPT__ is normally supported for that level. The reason
|
||||
for this is that such a compiler may have a compiler switch, enforcing a strict
|
||||
adherence to a particular C++ standard level, which gives a warning or an error
|
||||
if __VA_OPT__ is specified below the C++20 level, and the preprocessor library
|
||||
wants to avoid that happening. Therefore the macro will only test to see whether
|
||||
or not __VA_OPT__ is supported at the C++20 level, while otherwise always returning
|
||||
0 for all lesser C++ standard levels.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div> <b>Header:</b> <a href="../headers/variadic/has_opt.html"><boost/preprocessor/variadic/has_opt.hpp></a>
|
||||
</div>
|
||||
<h4>Sample Code</h4>
|
||||
<div>
|
||||
<pre>
|
||||
#include <<a href="../headers/variadic/has_opt.html">boost/preprocessor/variadic/has_opt.hpp</a>><br>
|
||||
#if <a href="variadic_has_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a>()
|
||||
// Preprocessor code which uses __VA_OPT__
|
||||
#else
|
||||
// Preprocessor code which does not use __VA_OPT__
|
||||
#endif
|
||||
</pre>
|
||||
<br>
|
||||
or within a macro definition<br><br>
|
||||
<pre>
|
||||
#include <boost/preprocessor/control/iif.hpp>
|
||||
#include <<a href="../headers/variadic/has_opt.html">boost/preprocessor/variadic/has_opt.hpp</a>><br>
|
||||
#define USE_OPT(...) BOOST_PP_IIF(<a href="variadic_has_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a>(),MACRO_USING_OPT,MACRO_NOT_USING_OPT)(__VA_ARGS__)
|
||||
#define MACRO_USING_OPT(...) __VA_OPT__( preprocessor tokens ) anything
|
||||
#define MACRO_NOT_USING_OPT(...) anything
|
||||
</pre>
|
||||
</div>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i></i><i><EFBFBD> Copyright Edward Diener 2019</i> </div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
|
||||
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -12,12 +12,12 @@
|
||||
<ul>
|
||||
<li><a href="add_d.html"><span style="color: gray;">BOOST_PP_ADD_D</span></a></li>
|
||||
<li><a href="div_d.html"><span style=" color: gray;">BOOST_PP_DIV_D</span></a></li>
|
||||
<li><a href="file:///C:/Programming/VersionControl/modular-boost/libs/preprocessor/doc/ref/div_d.html"><span
|
||||
<li><a href="div_d.html"><span
|
||||
style=" color: gray;"></span></a><a href="mod_d.html"><span style=" color: gray;">BOOST_PP_MOD_D</span></a></li>
|
||||
<li><a href="file:///C:/Programming/VersionControl/modular-boost/libs/preprocessor/doc/ref/mod_d.html"><span
|
||||
<li><a href="mod_d.html"><span
|
||||
style=" color: gray;"></span></a><a href="mul_d.html"><span
|
||||
style=" color: gray;">BOOST_PP_MUL_D</span></a></li>
|
||||
<li><a href="file:///C:/Programming/VersionControl/modular-boost/libs/preprocessor/doc/ref/mul_d.html"><span
|
||||
<li><a href="mul_d.html"><span
|
||||
style=" color: gray;"></span></a><a href="sub_d.html"><span
|
||||
style=" color: gray;">BOOST_PP_SUB_D</span></a></li>
|
||||
</ul>
|
||||
|
@ -284,6 +284,7 @@
|
||||
<!-- V -->
|
||||
<br>BOOST_PP_VALUE
|
||||
<br>BOOST_PP_VARIADIC_ELEM
|
||||
<br>BOOST_PP_VARIADIC_HAS_OPT
|
||||
<br>BOOST_PP_VARIADIC_SIZE
|
||||
<br>BOOST_PP_VARIADIC_TO_ARRAY
|
||||
<br>BOOST_PP_VARIADIC_TO_LIST
|
||||
|
@ -15,6 +15,7 @@
|
||||
<li><a href="topics/file_iteration.html">file iteration</a></li>
|
||||
<li><a href="topics/evaluated_slots.html">evaluated slots</a></li>
|
||||
<li><a href="topics/variadic_macros.html">variadic macros</a></li>
|
||||
<li><a href="topics/emptiness.html">emptiness</a></li>
|
||||
</ul>
|
||||
<!--
|
||||
<EFBFBD> Copyright Housemarque Oy 2002
|
||||
|
211
doc/topics/emptiness.html
Normal file
211
doc/topics/emptiness.html
Normal file
@ -0,0 +1,211 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252"
|
||||
http-equiv="content-type">
|
||||
<title>emptiness.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<style>
|
||||
u { font-weight: normal; text-decoration: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h4>Passing nothing</h4>
|
||||
<div> Although rarely desirable it has always been legal in C++ to
|
||||
pass nothing, aka no preprocessor tokens, as an argument when
|
||||
invoking a macro, whether the equivalent parameter be a regular
|
||||
parameter or a variadic one. </div>
|
||||
<div class="code">
|
||||
<pre> #define SOME_MACRO(Parameter1,Parameter2) macro expansion using Parameter1 and Parameter2
|
||||
#define SOME_VARIADIC_MACRO(Parameter1,...) macro expansion using Parameter1 and __VA_ARGS__
|
||||
|
||||
SOME_MACRO(a,b) // Normal
|
||||
SOME_MACRO(a,) // Legal, second argument is empty
|
||||
SOME_MACRO(,b) // Legal, first argument is empty
|
||||
SOME_MACRO(a) // Preprocessor error, passing the wrong number of arguments
|
||||
|
||||
SOME_VARIADIC_MACRO(a,b,c,d) // Normal
|
||||
SOME_VARIADIC_MACRO(a,) // Legal, variadic argument is empty
|
||||
SOME_VARIADIC_MACRO(,b,c,d) // Legal, first argument is empty
|
||||
SOME_VARIADIC_MACRO(a) /* Preprocessor error in standard below C++20 level,
|
||||
but in C++20 exactly equivalent to SOME_VARIADIC_MACRO(a,) */</pre>
|
||||
</div>
|
||||
<h4>Expanding to nothing</h4>
|
||||
<div> Given certain arguments a macro might expand to nothing, aka
|
||||
no preprocessor tokens. This may happen more than in the previous
|
||||
case of an argument to a macro being nothing because the expansion
|
||||
of a macro is often used to initialize some C++ construct, and C++
|
||||
has some places where a part of a compile-time construct can be
|
||||
empty. However a macro which expands to nothing rarely occurs when
|
||||
that macro's expansion is used as an argument to another macro
|
||||
because we would again have a macro where we are passing nothing
|
||||
as an argument. </div>
|
||||
<div class="code">
|
||||
<pre> #define ANOTHER_MACRO(Parameter1,Parameter2) /* expands to nothing when Parameter1 and Parameter2
|
||||
are numbers, otherwise expands to some preprocessing
|
||||
token, such as '1' */
|
||||
|
||||
int another_int = { ANOTHER_MACRO(x,y) }; // ANOTHER_MACRO Expands to 1
|
||||
int some_int = { ANOTHER_MACRO(1,2) }; // ANOTHER_MACRO Expands to nothing
|
||||
SOME_MACRO(ANOTHER_MACRO(x,y),z) // Normal, ANOTHER_MACRO Expands to 1
|
||||
SOME_MACRO(ANOTHER_MACRO(1,2),z) // Legal, first argument is empty as ANOTHER_MACRO Expands to nothing</pre>
|
||||
</div>
|
||||
<h4>Emptiness defined</h4>
|
||||
<div> Passing nothing as a macro argument or a macro expanding to
|
||||
nothing I term as 'emptiness', as 'nothing' is too amorphous a
|
||||
term which can be used in too many other contexts for my liking.
|
||||
In the vast majority of cases when designing a macro for use
|
||||
emptiness is not a part of such a design, and passing emptiness as
|
||||
an argument or expanding to emptiness is not anything that someone
|
||||
writing a macro takes into account when he explains to other
|
||||
programmers how a macro should be used.<br>
|
||||
<br>
|
||||
Other than the fact that macros are generally created so that some
|
||||
actual preprocessor data of a particular kind needs to be passed
|
||||
as arguments or gets generated as part of macro expansion when a
|
||||
macro is invoked, there is another very good reason why working
|
||||
with emptiness is not part of a macro's design: there has been no
|
||||
perfectly fail-safe way to test for emptiness during macro
|
||||
expansion, whether it be in creating macros using just the
|
||||
facilities of the C++ standard or using a 3rd party library, such
|
||||
as this Boost preprocessor library. When I say 'fail-safe' I mean
|
||||
that there has always been some argument input, no matter how
|
||||
small the number of potential cases, where a macro designed to
|
||||
test whether or not the preprocessor data passed to it as an
|
||||
argument when the macro is invoked is actually empty fails in some
|
||||
way, with the failure normally occurring as a preprocessor error.<br>
|
||||
<br>
|
||||
Of course this does not mean that the best macro designed to test
|
||||
for emptiness will not work correctly the vast majority of the
|
||||
time. It only means that there has been no guarantee that such a
|
||||
macro will work correctly all 100% of the time. Nonetheless there
|
||||
have been uses of testing for emptiness, when a macro documents
|
||||
what a particular argument should generally consist of, even if
|
||||
the test is not guaranteed to work 100% of the time if particular
|
||||
unexpected argument data does get passed. </div>
|
||||
<h4>A C++20 solution for testing for emptiness</h4>
|
||||
<div> The C++ standard committee recognized, in the upcoming
|
||||
specification for the C++20 standard, that a way of testing
|
||||
whether variadic data is empty or not in the expansion of a
|
||||
variadic macro would be very useful when designing certain types
|
||||
of macros. Because of this the C++20 standard added a preprocessor
|
||||
construct which could do this in a certain way for variadic data
|
||||
in the expansion of a variadic macro. The construct is called
|
||||
__VA_OPT__, as in '__VA_OPT__ ( prepocessing tokens )' specified
|
||||
in the replacement list of a variadic macro. <br>
|
||||
<br>
|
||||
The way that the __VA_OPT__ constructs works is that if the
|
||||
variadic arguments to the variadic macro are empty or expand to
|
||||
emptiness then the __VA_OPT__ construct and its enclosed
|
||||
preprocessing token data expands to nothing, or in C++ terms "a
|
||||
single placemarker preprocessing token". Otherwise the __VA_OPT__
|
||||
construct expands to its enclosed preprocessing tokens. A further,
|
||||
possibly unintended, upshot of adding the __VA_OPT__ construct to
|
||||
C++20 is that it is now possible to create a variadic macro which
|
||||
is 100% reliable in testing for emptiness whenever a compiler
|
||||
supports the __VA_OPT__ construct in its compilation of
|
||||
preprocessor code.<br>
|
||||
<br>
|
||||
For such a macro to always work which tests for emptiness the code
|
||||
must know when the __VA_OPT__ construct is available. It is not
|
||||
enough to know that a compiler is working at the C++20 level,
|
||||
since as all C++ programmers know an adherence to a C++ standard
|
||||
level never guarantees that a particular compiler supports every
|
||||
aspect of that level. Happily there is a way to test whether a
|
||||
compiler supports the __VA_OPT__ construct as long as the compiler
|
||||
supports variadic macros, and that way has been openly published
|
||||
on the Internet, although the actual macro code would not have
|
||||
been hard to create even if it had not publicly appeared. This
|
||||
library uses that code to test for __VA_OPT__ as a necessary
|
||||
prelude for creating a variadic macro which is 100% reliable in
|
||||
testing for emptiness.<br>
|
||||
<br>
|
||||
The Boost Preprocessor macro for testing whether the __VA_OPT__
|
||||
construct is supported during compilation is called
|
||||
BOOST_PP_VARIADIC_HAS_OPT, which is a function-like macro taking
|
||||
no parameters and returning 1 if the __VA_OPT__ construct is
|
||||
supported and 0 if it is not. The macro only returns 1 when
|
||||
variadic macros are supported, when the compiler is at the C++20
|
||||
level, and when the __VA_OPT__ construct can be used according to
|
||||
the C++20 standard. In particular the macro needs the compiler to
|
||||
be working at the C++20 level despite the fact that at least one
|
||||
major compiler supports the __VA_OPT__ construct in some of its
|
||||
latest releases even when the compiler is being used at a C++
|
||||
standard level below that of C++20. The reason this Boost
|
||||
preprocessor library requires the C++20 level is because that same
|
||||
major compiler can produce a warning, or even an error, when it
|
||||
even sees a macro using the __VA_OPT__ construct at a level below
|
||||
C++20, even though it supports it, if other compiler options
|
||||
requiring strict adherence to the level of the C++ standard being
|
||||
used are passed on the command line. So taking a conservative
|
||||
approach the BOOST_PP_VARIADIC_HAS_OPT macros requires compilation
|
||||
at the C++20 level, along with variadic macro support, along with
|
||||
the testing code expanding to 1, in order to specify that
|
||||
__VA_OPT__ is supported.<br>
|
||||
<br>
|
||||
The actual Boost Preprocessor library for testing for emptiness in
|
||||
C++20 mode is called BOOST_PP_CHECK_EMPTY. The macro is a variadic
|
||||
macro with a single variadic parameter. The macro only exists if
|
||||
our previous macro for testing for __VA_OPT__, called
|
||||
BOOST_PP_VARIADIC_HAS_OPT, expands to 1 when invoked as
|
||||
BOOST_PP_VARIADIC_HAS_OPT(). If BOOST_PP_VARIADIC_HAS_OPT()
|
||||
expands to 0 the BOOST_PP_CHECK_EMPTY macro does not exist at all
|
||||
in this library. The input to the BOOST_PP_CHECK_EMPTY macro can
|
||||
be any variadic data. If the data passed to the macro is empty, or
|
||||
if the data passed to the macro is not empty but when the data
|
||||
itself is expanded it is empty, the macro returns 1, otherwise it
|
||||
returns 0. The macro works 100% of the time and is completely
|
||||
reliable no matter what preprocessor data is passed to it. But of
|
||||
course it only works when compiling at the C++20 level with the
|
||||
__VA_OPT__ construct supported by the compiler. It solves an old
|
||||
problem that it has never been possible, prior to C++20, to
|
||||
provide a 100% reliable implementation of a macro which tests for
|
||||
emptiness in C++.<br>
|
||||
<br>
|
||||
Along with the valuable BOOST_PP_CHECK_EMPTY macro the Boost
|
||||
Preprocessor library has also added a more flexible, if slightly
|
||||
verbose, alternative to the __VA_OPT__ construct, which works by
|
||||
using the ability of BOOST_PP_CHECK_EMPTY to reliably test for
|
||||
emptiness. This macro is called BOOST_PP_VA_OPT and allows the
|
||||
programmer to specify preprocessing tokens for expansion both when
|
||||
the variadic data is <b>not</b> empty and when the variadic data
|
||||
is empty. This improves on the __VA_OPT__ construct's ability to
|
||||
specify preprocessing tokens for expansion only when the variadic
|
||||
data is not empty. Like BOOST_PP_CHECK_EMPTY, which it uses, the
|
||||
BOOST_PP_VA_OPT macro only exists when BOOST_PP_VARIADIC_HAS_OPT()
|
||||
expands to 1. You can read further about how this macro works as
|
||||
an alternative to the C++20 __VA_OPT__ construct in the
|
||||
documentation for the macro itself.<br>
|
||||
<br>
|
||||
Eventually more C++ compilers will support C++20 and the
|
||||
__VA_OPT__ construct and more programmers will use compilers at
|
||||
the C++20 level. At that point the macro BOOST_PP_CHECK_EMPTY can
|
||||
be used reliably for testing emptiness in preprocessor data in
|
||||
macro code by all those programmers. The BOOST_PP_VA_OPT macro
|
||||
serves as a useful example of such use. This does not mean that
|
||||
designing macros with emptiness in mind needs to be done, much
|
||||
less considered, but that the possibility of doing so with
|
||||
complete reliability will be there if needed by the macro
|
||||
programmer. Along with the __VA_OPT__ construct as mandated by the
|
||||
C++20 standard the BOOST_PP_CHECK_EMPTY and BOOST_PP_VA_OPT macros
|
||||
add three more tools in the arsenal of macro programming, which is
|
||||
a good thing, while programmers who wanted to ignore any dealing
|
||||
with emptiness in macro code can continue to do so. </div>
|
||||
<b>See</b> <b>Also</b><br>
|
||||
<ul>
|
||||
<li><a href="../ref/variadic_has_opt.html">BOOST_PP_VARIADIC_HAS_OPT</a></li>
|
||||
<li><a href="../ref/check_empty.html">BOOST_PP_CHECK_EMPTY</a></li>
|
||||
<li><a href="../ref/va_opt.html">BOOST_PP_VA_OPT</a><br>
|
||||
</li>
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i><EFBFBD> Copyright Edward Diener 2019</i>
|
||||
</div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version
|
||||
1.0. (See accompanying file <a
|
||||
href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
|
||||
copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -136,6 +136,27 @@
|
||||
use this variadic data reliably as arguments to other macros, one needs
|
||||
variadic macro support.<br>
|
||||
</div>
|
||||
<h4>C++20 Support For Variadic Macros</h4>
|
||||
<div>
|
||||
In the C++20 specification there is a new construct which can be
|
||||
used in the expansion of a variadic macro, called __VA_OPT__. This
|
||||
construct when used in the expansion of a variadic macro is followed
|
||||
by an opening paranthesis ('('), preprocessor data, and a closing
|
||||
parenthesis ('}'). When the variadic data passed by the invocation
|
||||
of a variadic macro is empty, this new construct expands to nothing.
|
||||
When the variadic data passed by the invocation of a variadic macro
|
||||
is not empty, this new construct expands to the preprocessor data
|
||||
between its opening and closing parentheses.
|
||||
<br><br>
|
||||
This library offers support for this new C++20 construct by automatically
|
||||
detecting whether this new construct is supported by the compiler's
|
||||
preprocessor when using the library. The library macro which detects
|
||||
support for the __VA_OPT__ construct is called BOOST_PP_VARIADIC_HAS_OPT.
|
||||
This is a function-like macro which takes no parameters and returns
|
||||
1 if the compiler is working in C++20 mode and supports the __VA_OPT__
|
||||
construct, while otherwise it returns 0.
|
||||
<br>
|
||||
</div>
|
||||
<u style="font-weight: bold;"> Using a Tuple Instead of an Array<br>
|
||||
</u>
|
||||
<div>An array as a preprocessor data type is a two-element tuple where the
|
||||
@ -257,6 +278,5 @@
|
||||
(See accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a>
|
||||
or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
|
||||
</div>
|
||||
|
||||
|
||||
</body></html>
|
||||
</body>
|
||||
</html>
|
@ -23,33 +23,33 @@
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_NONE(size, data)
|
||||
|
||||
# if BOOST_PP_VARIADICS && !(BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400)
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_DEFAULT(size, data) BOOST_PP_TUPLE_REM(size) data
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_CAT(size, data) BOOST_PP_TUPLE_REM_CAT(size) data
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_IS_1(size), \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_CAT, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_DEFAULT \
|
||||
) \
|
||||
(size,data) \
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_DEFAULT(size, data) BOOST_PP_TUPLE_REM(size) data
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_CAT(size, data) BOOST_PP_TUPLE_REM_CAT(size) data
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_IS_1(size), \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_CAT, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY_VC_DEFAULT \
|
||||
) \
|
||||
(size,data) \
|
||||
/**/
|
||||
# else
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) BOOST_PP_TUPLE_REM(size) data
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) BOOST_PP_TUPLE_REM(size) data
|
||||
# endif
|
||||
# else
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) BOOST_PP_TUPLE_REM(size) data
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY(size, data) BOOST_PP_TUPLE_REM(size) data
|
||||
# endif
|
||||
|
||||
# define BOOST_PP_ARRAY_DETAIL_GET_DATA(size, data) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
size, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_NONE \
|
||||
) \
|
||||
(size,data) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
size, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_ANY, \
|
||||
BOOST_PP_ARRAY_DETAIL_GET_DATA_NONE \
|
||||
) \
|
||||
(size,data) \
|
||||
/**/
|
||||
#
|
||||
# endif /* BOOST_PREPROCESSOR_ARRAY_DETAIL_GET_DATA_HPP */
|
||||
|
@ -22,13 +22,13 @@
|
||||
# /* BOOST_PP_ARRAY_TO_LIST */
|
||||
#
|
||||
# define BOOST_PP_ARRAY_TO_LIST(array) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
BOOST_PP_ARRAY_SIZE(array), \
|
||||
BOOST_PP_ARRAY_TO_LIST_DO, \
|
||||
BOOST_PP_ARRAY_TO_LIST_EMPTY \
|
||||
) \
|
||||
(array) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
BOOST_PP_ARRAY_SIZE(array), \
|
||||
BOOST_PP_ARRAY_TO_LIST_DO, \
|
||||
BOOST_PP_ARRAY_TO_LIST_EMPTY \
|
||||
) \
|
||||
(array) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_ARRAY_TO_LIST_EMPTY(array) BOOST_PP_NIL
|
||||
|
@ -22,13 +22,13 @@
|
||||
# /* BOOST_PP_ARRAY_TO_SEQ */
|
||||
#
|
||||
# define BOOST_PP_ARRAY_TO_SEQ(array) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
BOOST_PP_ARRAY_SIZE(array), \
|
||||
BOOST_PP_ARRAY_TO_SEQ_DO, \
|
||||
BOOST_PP_ARRAY_TO_SEQ_EMPTY \
|
||||
) \
|
||||
(array) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
BOOST_PP_ARRAY_SIZE(array), \
|
||||
BOOST_PP_ARRAY_TO_SEQ_DO, \
|
||||
BOOST_PP_ARRAY_TO_SEQ_EMPTY \
|
||||
) \
|
||||
(array) \
|
||||
/**/
|
||||
# define BOOST_PP_ARRAY_TO_SEQ_EMPTY(array)
|
||||
#
|
||||
|
@ -20,13 +20,13 @@
|
||||
# /* BOOST_PP_ARRAY_TO_TUPLE */
|
||||
#
|
||||
# define BOOST_PP_ARRAY_TO_TUPLE(array) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
BOOST_PP_ARRAY_SIZE(array), \
|
||||
BOOST_PP_ARRAY_DATA, \
|
||||
BOOST_PP_ARRAY_TO_TUPLE_EMPTY \
|
||||
) \
|
||||
(array) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
BOOST_PP_ARRAY_SIZE(array), \
|
||||
BOOST_PP_ARRAY_DATA, \
|
||||
BOOST_PP_ARRAY_TO_TUPLE_EMPTY \
|
||||
) \
|
||||
(array) \
|
||||
/**/
|
||||
# define BOOST_PP_ARRAY_TO_TUPLE_EMPTY(array)
|
||||
#
|
||||
|
@ -29,7 +29,11 @@
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# elif defined(__EDG__) || defined(__EDG_VERSION__)
|
||||
# if defined(_MSC_VER) && !defined(__clang__) && (defined(__INTELLISENSE__) || __EDG_VERSION__ >= 308)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC())
|
||||
# if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC())
|
||||
# else
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# endif
|
||||
# else
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_EDG() | BOOST_PP_CONFIG_STRICT())
|
||||
# endif
|
||||
@ -44,7 +48,11 @@
|
||||
# elif defined(__BORLANDC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_BCC())
|
||||
# elif defined(_MSC_VER)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC())
|
||||
# if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC())
|
||||
# else
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# endif
|
||||
# else
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# endif
|
||||
@ -71,15 +79,18 @@
|
||||
# define BOOST_PP_VARIADICS_MSVC 0
|
||||
# if !defined BOOST_PP_VARIADICS
|
||||
# /* variadic support explicitly disabled for all untested compilers */
|
||||
# if defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || ( defined __SUNPRO_CC && __SUNPRO_CC < 0x5120 ) || defined __HP_aCC && !defined __EDG__ || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI
|
||||
|
||||
# if defined __GCCXML__ || (defined __NVCC__ && defined __CUDACC__) || defined __PATHSCALE__ || defined __DMC__ || (defined __CODEGEARC__ && !defined(__clang__)) || (defined __BORLANDC__ && !defined(__clang__)) || defined __MWERKS__ || ( defined __SUNPRO_CC && __SUNPRO_CC < 0x5120 ) || (defined __HP_aCC && !defined __EDG__) || defined __MRC__ || defined __SC__ || (defined(__PGI) && !defined(__EDG__))
|
||||
# define BOOST_PP_VARIADICS 0
|
||||
# elif defined(_MSC_VER) && defined(__clang__)
|
||||
# define BOOST_PP_VARIADICS 1
|
||||
# /* VC++ (C/C++) and Intel C++ Compiler >= 17.0 with MSVC */
|
||||
# elif defined _MSC_VER && _MSC_VER >= 1400 && (!defined __EDG__ || defined(__INTELLISENSE__) || defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700)
|
||||
# define BOOST_PP_VARIADICS 1
|
||||
# undef BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_VARIADICS_MSVC 1
|
||||
# if !defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL
|
||||
# undef BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_VARIADICS_MSVC 1
|
||||
# endif
|
||||
# /* Wave (C/C++), GCC (C++) */
|
||||
# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && defined __GXX_EXPERIMENTAL_CXX0X__ && __GXX_EXPERIMENTAL_CXX0X__
|
||||
# define BOOST_PP_VARIADICS 1
|
||||
@ -92,7 +103,7 @@
|
||||
# elif !BOOST_PP_VARIADICS + 1 < 2
|
||||
# undef BOOST_PP_VARIADICS
|
||||
# define BOOST_PP_VARIADICS 1
|
||||
# if defined _MSC_VER && _MSC_VER >= 1400 && !defined(__clang__) && (defined(__INTELLISENSE__) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) || !(defined __EDG__ || defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || defined __SUNPRO_CC || defined __HP_aCC || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI))
|
||||
# if defined _MSC_VER && _MSC_VER >= 1400 && !defined(__clang__) && (defined(__INTELLISENSE__) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700) || !(defined __EDG__ || defined __GCCXML__ || (defined __NVCC__ && defined __CUDACC__) || defined __PATHSCALE__ || defined __DMC__ || defined __CODEGEARC__ || defined __BORLANDC__ || defined __MWERKS__ || defined __SUNPRO_CC || defined __HP_aCC || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI)) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL)
|
||||
# undef BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_VARIADICS_MSVC 1
|
||||
# endif
|
||||
|
@ -14,10 +14,12 @@
|
||||
# define BOOST_PREPROCESSOR_FACILITIES_HPP
|
||||
#
|
||||
# include <boost/preprocessor/facilities/apply.hpp>
|
||||
# include <boost/preprocessor/facilities/check_empty.hpp>
|
||||
# include <boost/preprocessor/facilities/empty.hpp>
|
||||
# include <boost/preprocessor/facilities/expand.hpp>
|
||||
# include <boost/preprocessor/facilities/identity.hpp>
|
||||
# include <boost/preprocessor/facilities/intercept.hpp>
|
||||
# include <boost/preprocessor/facilities/overload.hpp>
|
||||
# include <boost/preprocessor/facilities/va_opt.hpp>
|
||||
#
|
||||
# endif
|
||||
|
19
include/boost/preprocessor/facilities/check_empty.hpp
Normal file
19
include/boost/preprocessor/facilities/check_empty.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_FACILITIES_CHECK_EMPTY_HPP
|
||||
# define BOOST_PREPROCESSOR_FACILITIES_CHECK_EMPTY_HPP
|
||||
# include <boost/preprocessor/variadic/has_opt.hpp>
|
||||
# if BOOST_PP_VARIADIC_HAS_OPT()
|
||||
# include <boost/preprocessor/facilities/is_empty_variadic.hpp>
|
||||
# define BOOST_PP_CHECK_EMPTY(...) BOOST_PP_IS_EMPTY_OPT(__VA_ARGS__)
|
||||
# endif /* BOOST_PP_VARIADIC_HAS_OPT() */
|
||||
# endif /* BOOST_PREPROCESSOR_FACILITIES_CHECK_EMPTY_HPP */
|
@ -31,8 +31,8 @@
|
||||
#if BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400
|
||||
|
||||
#define BOOST_PP_DETAIL_IS_EMPTY_PROCESS(param) \
|
||||
BOOST_PP_IS_BEGIN_PARENS \
|
||||
( \
|
||||
BOOST_PP_IS_BEGIN_PARENS \
|
||||
( \
|
||||
BOOST_PP_DETAIL_IS_EMPTY_NON_FUNCTION_C param () \
|
||||
) \
|
||||
/**/
|
||||
@ -40,7 +40,7 @@
|
||||
#else
|
||||
|
||||
#define BOOST_PP_DETAIL_IS_EMPTY_PROCESS(...) \
|
||||
BOOST_PP_IS_BEGIN_PARENS \
|
||||
BOOST_PP_IS_BEGIN_PARENS \
|
||||
( \
|
||||
BOOST_PP_DETAIL_IS_EMPTY_NON_FUNCTION_C __VA_ARGS__ () \
|
||||
) \
|
||||
|
@ -1,6 +1,6 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * (C) Copyright Edward Diener 2014,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)
|
||||
@ -37,7 +37,34 @@
|
||||
/**/
|
||||
#define BOOST_PP_IS_EMPTY_ZERO(param) 0
|
||||
# else
|
||||
# if defined(__cplusplus) && __cplusplus > 201703L
|
||||
# include <boost/preprocessor/variadic/has_opt.hpp>
|
||||
#define BOOST_PP_IS_EMPTY(...) \
|
||||
BOOST_PP_DETAIL_IS_EMPTY_IIF \
|
||||
( \
|
||||
BOOST_PP_VARIADIC_HAS_OPT() \
|
||||
) \
|
||||
( \
|
||||
BOOST_PP_IS_EMPTY_OPT, \
|
||||
BOOST_PP_IS_EMPTY_NO_OPT \
|
||||
) \
|
||||
(__VA_ARGS__) \
|
||||
/**/
|
||||
#define BOOST_PP_IS_EMPTY_FUNCTION2(...) \
|
||||
__VA_OPT__(0,) 1 \
|
||||
/**/
|
||||
#define BOOST_PP_IS_EMPTY_FUNCTION(...) \
|
||||
BOOST_PP_IS_EMPTY_FUNCTION2(__VA_ARGS__) \
|
||||
/**/
|
||||
#define BOOST_PP_IS_EMPTY_OPT(...) \
|
||||
BOOST_PP_VARIADIC_HAS_OPT_ELEM0(BOOST_PP_IS_EMPTY_FUNCTION(__VA_ARGS__),) \
|
||||
/**/
|
||||
# else
|
||||
#define BOOST_PP_IS_EMPTY(...) \
|
||||
BOOST_PP_IS_EMPTY_NO_OPT(__VA_ARGS__) \
|
||||
/**/
|
||||
# endif /* defined(__cplusplus) && __cplusplus > 201703L */
|
||||
#define BOOST_PP_IS_EMPTY_NO_OPT(...) \
|
||||
BOOST_PP_DETAIL_IS_EMPTY_IIF \
|
||||
( \
|
||||
BOOST_PP_IS_BEGIN_PARENS \
|
||||
|
34
include/boost/preprocessor/facilities/va_opt.hpp
Normal file
34
include/boost/preprocessor/facilities/va_opt.hpp
Normal file
@ -0,0 +1,34 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_FACILITIES_VA_OPT_HPP
|
||||
# define BOOST_PREPROCESSOR_FACILITIES_VA_OPT_HPP
|
||||
# include <boost/preprocessor/variadic/has_opt.hpp>
|
||||
# if BOOST_PP_VARIADIC_HAS_OPT()
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/facilities/check_empty.hpp>
|
||||
# include <boost/preprocessor/tuple/rem.hpp>
|
||||
# define BOOST_PP_VA_OPT_IMPL(atuple) \
|
||||
BOOST_PP_TUPLE_REM() atuple \
|
||||
/**/
|
||||
# define BOOST_PP_VA_OPT(rdata,rempty,...) \
|
||||
BOOST_PP_VA_OPT_IMPL \
|
||||
( \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_CHECK_EMPTY(__VA_ARGS__), \
|
||||
rempty, \
|
||||
rdata \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
# endif /* BOOST_PP_VARIADIC_HAS_OPT() */
|
||||
# endif /* BOOST_PREPROCESSOR_FACILITIES_VA_OPT_HPP */
|
@ -28,13 +28,13 @@
|
||||
#
|
||||
# if BOOST_PP_VARIADICS && BOOST_PP_VARIADICS_MSVC && (_MSC_VER <= 1400)
|
||||
# define BOOST_PP_LIST_TO_ARRAY(list) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_LIST_IS_NIL(list), \
|
||||
BOOST_PP_LIST_TO_ARRAY_VC8ORLESS_EMPTY, \
|
||||
BOOST_PP_LIST_TO_ARRAY_VC8ORLESS_DO \
|
||||
) \
|
||||
(list) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_LIST_IS_NIL(list), \
|
||||
BOOST_PP_LIST_TO_ARRAY_VC8ORLESS_EMPTY, \
|
||||
BOOST_PP_LIST_TO_ARRAY_VC8ORLESS_DO \
|
||||
) \
|
||||
(list) \
|
||||
/**/
|
||||
# define BOOST_PP_LIST_TO_ARRAY_VC8ORLESS_EMPTY(list) (0,())
|
||||
# define BOOST_PP_LIST_TO_ARRAY_VC8ORLESS_DO(list) BOOST_PP_LIST_TO_ARRAY_I(BOOST_PP_WHILE, list)
|
||||
@ -46,7 +46,7 @@
|
||||
# define BOOST_PP_LIST_TO_ARRAY_I(w, list) \
|
||||
BOOST_PP_LIST_TO_ARRAY_II(((BOOST_PP_TUPLE_REM_CTOR( \
|
||||
3, \
|
||||
w(BOOST_PP_LIST_TO_ARRAY_P, BOOST_PP_LIST_TO_ARRAY_O, (list, 1, (~))) \
|
||||
w(BOOST_PP_LIST_TO_ARRAY_P, BOOST_PP_LIST_TO_ARRAY_O, (list, 1, (~))) \
|
||||
)))) \
|
||||
/**/
|
||||
# define BOOST_PP_LIST_TO_ARRAY_II(p) BOOST_PP_LIST_TO_ARRAY_II_B(p)
|
||||
@ -56,7 +56,7 @@
|
||||
# define BOOST_PP_LIST_TO_ARRAY_I(w, list) \
|
||||
BOOST_PP_LIST_TO_ARRAY_II(BOOST_PP_TUPLE_REM_CTOR( \
|
||||
3, \
|
||||
w(BOOST_PP_LIST_TO_ARRAY_P, BOOST_PP_LIST_TO_ARRAY_O, (list, 1, (~))) \
|
||||
w(BOOST_PP_LIST_TO_ARRAY_P, BOOST_PP_LIST_TO_ARRAY_O, (list, 1, (~))) \
|
||||
)) \
|
||||
/**/
|
||||
# define BOOST_PP_LIST_TO_ARRAY_II(im) BOOST_PP_LIST_TO_ARRAY_III(im)
|
||||
@ -138,13 +138,13 @@
|
||||
#
|
||||
# if BOOST_PP_VARIADICS && BOOST_PP_VARIADICS_MSVC && (_MSC_VER <= 1400)
|
||||
# define BOOST_PP_LIST_TO_ARRAY_D(d, list) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_LIST_IS_NIL(list), \
|
||||
BOOST_PP_LIST_TO_ARRAY_D_VC8ORLESS_EMPTY, \
|
||||
BOOST_PP_LIST_TO_ARRAY_D_VC8ORLESS_DO \
|
||||
) \
|
||||
(d, list) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_LIST_IS_NIL(list), \
|
||||
BOOST_PP_LIST_TO_ARRAY_D_VC8ORLESS_EMPTY, \
|
||||
BOOST_PP_LIST_TO_ARRAY_D_VC8ORLESS_DO \
|
||||
) \
|
||||
(d, list) \
|
||||
/**/
|
||||
# define BOOST_PP_LIST_TO_ARRAY_D_VC8ORLESS_EMPTY(d, list) (0,())
|
||||
# define BOOST_PP_LIST_TO_ARRAY_D_VC8ORLESS_DO(d, list) BOOST_PP_LIST_TO_ARRAY_I(BOOST_PP_WHILE_ ## d, list)
|
||||
|
@ -21,13 +21,13 @@
|
||||
# /* BOOST_PP_LIST_TO_TUPLE */
|
||||
#
|
||||
# define BOOST_PP_LIST_TO_TUPLE(list) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_LIST_IS_NIL(list), \
|
||||
BOOST_PP_LIST_TO_TUPLE_EMPTY, \
|
||||
BOOST_PP_LIST_TO_TUPLE_DO \
|
||||
) \
|
||||
(list) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_LIST_IS_NIL(list), \
|
||||
BOOST_PP_LIST_TO_TUPLE_EMPTY, \
|
||||
BOOST_PP_LIST_TO_TUPLE_DO \
|
||||
) \
|
||||
(list) \
|
||||
/**/
|
||||
# define BOOST_PP_LIST_TO_TUPLE_EMPTY(list)
|
||||
#
|
||||
@ -41,13 +41,13 @@
|
||||
# /* BOOST_PP_LIST_TO_TUPLE_R */
|
||||
#
|
||||
# define BOOST_PP_LIST_TO_TUPLE_R(r, list) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_LIST_IS_NIL(list), \
|
||||
BOOST_PP_LIST_TO_TUPLE_R_EMPTY, \
|
||||
BOOST_PP_LIST_TO_TUPLE_R_DO \
|
||||
) \
|
||||
(r, list) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_LIST_IS_NIL(list), \
|
||||
BOOST_PP_LIST_TO_TUPLE_R_EMPTY, \
|
||||
BOOST_PP_LIST_TO_TUPLE_R_DO \
|
||||
) \
|
||||
(r, list) \
|
||||
/**/
|
||||
# define BOOST_PP_LIST_TO_TUPLE_R_EMPTY(r,list)
|
||||
#
|
||||
|
@ -52,13 +52,13 @@
|
||||
|
||||
# define BOOST_PP_FOR_257_ERROR() BOOST_PP_ERROR(0x0002)
|
||||
# define BOOST_PP_FOR_257(s, p, o, m) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_FOR_257_PR(s,p), \
|
||||
BOOST_PP_FOR_257_ERROR, \
|
||||
BOOST_PP_EMPTY \
|
||||
) \
|
||||
() \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_FOR_257_PR(s,p), \
|
||||
BOOST_PP_FOR_257_ERROR, \
|
||||
BOOST_PP_EMPTY \
|
||||
) \
|
||||
() \
|
||||
/**/
|
||||
// # define BOOST_PP_FOR_257(s, p, o, m) BOOST_PP_ERROR(0x0002)
|
||||
#
|
||||
|
@ -30,13 +30,13 @@
|
||||
# endif
|
||||
# if BOOST_PP_VARIADICS
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_REM(data) data
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_REM(data) data
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_A(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_B
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_B(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_A
|
||||
# else
|
||||
# else
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_A(...) (BOOST_PP_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_B
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_B(...) (BOOST_PP_REM, __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_A
|
||||
# endif
|
||||
# endif
|
||||
# else
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_A(e) (BOOST_PP_REM, e)() BOOST_PP_SEQ_BINARY_TRANSFORM_B
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_B(e) (BOOST_PP_REM, e)() BOOST_PP_SEQ_BINARY_TRANSFORM_A
|
||||
|
@ -21,29 +21,29 @@
|
||||
/* An empty seq is one that is just BOOST_PP_SEQ_NIL */
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_IS_EMPTY(seq) \
|
||||
BOOST_PP_COMPL \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq) \
|
||||
) \
|
||||
BOOST_PP_COMPL \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq) \
|
||||
) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_IS_EMPTY_SIZE(size) \
|
||||
BOOST_PP_COMPL \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size) \
|
||||
) \
|
||||
BOOST_PP_COMPL \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size) \
|
||||
) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq) \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(BOOST_PP_SEQ_DETAIL_EMPTY_SIZE(seq)) \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(BOOST_PP_SEQ_DETAIL_EMPTY_SIZE(seq)) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size) \
|
||||
BOOST_PP_BOOL(size) \
|
||||
BOOST_PP_BOOL(size) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_EMPTY_SIZE(seq) \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq (nil))) \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq (nil))) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -36,13 +36,13 @@
|
||||
# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY(macro, data, seq)
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK(macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(macro, data, seq) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_P(r, x) BOOST_PP_TUPLE_ELEM(4, 3, x)
|
||||
@ -54,21 +54,21 @@
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O_I(macro, data, seq, sz) \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_DEC(macro, data, seq, BOOST_PP_DEC(sz)) \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_DEC(macro, data, seq, BOOST_PP_DEC(sz)) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O_I_DEC(macro, data, seq, sz) \
|
||||
( \
|
||||
macro, \
|
||||
data, \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
sz, \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_TAIL, \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_NIL \
|
||||
) \
|
||||
(seq), \
|
||||
sz \
|
||||
) \
|
||||
( \
|
||||
macro, \
|
||||
data, \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
sz, \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_TAIL, \
|
||||
BOOST_PP_SEQ_FOR_EACH_O_I_NIL \
|
||||
) \
|
||||
(seq), \
|
||||
sz \
|
||||
) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O_I_TAIL(seq) BOOST_PP_SEQ_TAIL(seq)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O_I_NIL(seq) BOOST_PP_NIL
|
||||
@ -95,13 +95,13 @@
|
||||
# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY_R(r, macro, data, seq)
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_R(r, macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC_R, \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY_R \
|
||||
) \
|
||||
(r, macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC_R, \
|
||||
BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EMPTY_R \
|
||||
) \
|
||||
(r, macro, data, seq) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -37,13 +37,13 @@
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EMPTY(macro, data, seq)
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK(macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(macro, data, seq) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_P(r, x) BOOST_PP_TUPLE_ELEM(5, 4, x)
|
||||
@ -55,22 +55,22 @@
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O_I(macro, data, seq, i, sz) \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_DEC(macro, data, seq, i, BOOST_PP_DEC(sz)) \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_DEC(macro, data, seq, i, BOOST_PP_DEC(sz)) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O_I_DEC(macro, data, seq, i, sz) \
|
||||
( \
|
||||
macro, \
|
||||
data, \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
sz, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_TAIL, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_NIL \
|
||||
) \
|
||||
(seq), \
|
||||
BOOST_PP_INC(i), \
|
||||
sz \
|
||||
) \
|
||||
( \
|
||||
macro, \
|
||||
data, \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
sz, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_TAIL, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_O_I_NIL \
|
||||
) \
|
||||
(seq), \
|
||||
BOOST_PP_INC(i), \
|
||||
sz \
|
||||
) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O_I_TAIL(seq) BOOST_PP_SEQ_TAIL(seq)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O_I_NIL(seq) BOOST_PP_NIL
|
||||
@ -97,13 +97,13 @@
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EMPTY(r, macro, data, seq)
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK(r, macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(r, macro, data, seq) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY(seq), \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EXEC, \
|
||||
BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EMPTY \
|
||||
) \
|
||||
(r, macro, data, seq) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -33,13 +33,13 @@
|
||||
# define BOOST_PP_SEQ_REPLACE_DETAIL_REST_EMPTY(seq, i)
|
||||
# define BOOST_PP_SEQ_REPLACE_DETAIL_REST_VALID(seq, i) BOOST_PP_SEQ_REST_N(BOOST_PP_INC(i), seq)
|
||||
# define BOOST_PP_SEQ_REPLACE_DETAIL_REST(seq, i) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_EQUAL(i,BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq))), \
|
||||
BOOST_PP_SEQ_REPLACE_DETAIL_REST_EMPTY, \
|
||||
BOOST_PP_SEQ_REPLACE_DETAIL_REST_VALID \
|
||||
) \
|
||||
(seq, i) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_EQUAL(i,BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq))), \
|
||||
BOOST_PP_SEQ_REPLACE_DETAIL_REST_EMPTY, \
|
||||
BOOST_PP_SEQ_REPLACE_DETAIL_REST_VALID \
|
||||
) \
|
||||
(seq, i) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -32,15 +32,15 @@
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_REST_N_DETAIL_EXEC(n, seq, size) \
|
||||
BOOST_PP_EXPR_IIF \
|
||||
( \
|
||||
BOOST_PP_BITAND \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size), \
|
||||
BOOST_PP_NOT_EQUAL(n,size) \
|
||||
), \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), BOOST_PP_IDENTITY( (nil) seq )))() \
|
||||
) \
|
||||
BOOST_PP_EXPR_IIF \
|
||||
( \
|
||||
BOOST_PP_BITAND \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size), \
|
||||
BOOST_PP_NOT_EQUAL(n,size) \
|
||||
), \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), BOOST_PP_IDENTITY( (nil) seq )))() \
|
||||
) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -28,6 +28,10 @@
|
||||
# define BOOST_PP_STRINGIZE(text) BOOST_PP_STRINGIZE_I(text)
|
||||
# endif
|
||||
#
|
||||
#if BOOST_PP_VARIADICS
|
||||
# define BOOST_PP_STRINGIZE_I(...) #__VA_ARGS__
|
||||
#else
|
||||
# define BOOST_PP_STRINGIZE_I(text) #text
|
||||
#endif
|
||||
#
|
||||
# endif
|
||||
|
@ -20,9 +20,9 @@
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/facilities/is_1.hpp>
|
||||
# include <boost/preprocessor/tuple/size.hpp>
|
||||
# define BOOST_PP_TUPLE_IS_SINGLE_RETURN(sr,nsr,tuple) \
|
||||
BOOST_PP_IIF(BOOST_PP_IS_1(BOOST_PP_TUPLE_SIZE(tuple)),sr,nsr) \
|
||||
/**/
|
||||
# define BOOST_PP_TUPLE_IS_SINGLE_RETURN(sr,nsr,tuple) \
|
||||
BOOST_PP_IIF(BOOST_PP_IS_1(BOOST_PP_TUPLE_SIZE(tuple)),sr,nsr) \
|
||||
/**/
|
||||
# endif /* BOOST_PP_VARIADICS && BOOST_PP_VARIADICS_MSVC */
|
||||
#
|
||||
# endif /* BOOST_PREPROCESSOR_TUPLE_DETAIL_IS_SINGLE_RETURN_HPP */
|
||||
|
@ -33,12 +33,12 @@
|
||||
else use BOOST_PP_REM. This fixes a VC++ problem with an empty tuple and BOOST_PP_TUPLE_ELEM
|
||||
functionality. See tuple_elem_bug_test.cxx.
|
||||
*/
|
||||
# define BOOST_PP_TUPLE_ELEM_O_2(n, tuple) \
|
||||
BOOST_PP_VARIADIC_ELEM(n, BOOST_PP_EXPAND(BOOST_PP_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) tuple)) \
|
||||
/**/
|
||||
# define BOOST_PP_TUPLE_ELEM_O_2(n, tuple) \
|
||||
BOOST_PP_VARIADIC_ELEM(n, BOOST_PP_EXPAND(BOOST_PP_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) tuple)) \
|
||||
/**/
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_ELEM(...) BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_ELEM_O_, __VA_ARGS__)(__VA_ARGS__)
|
||||
# define BOOST_PP_TUPLE_ELEM_O_2(n, tuple) BOOST_PP_VARIADIC_ELEM(n, BOOST_PP_REM tuple)
|
||||
# define BOOST_PP_TUPLE_ELEM_O_2(n, tuple) BOOST_PP_VARIADIC_ELEM(n, BOOST_PP_REM tuple)
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_ELEM_O_3(size, n, tuple) BOOST_PP_TUPLE_ELEM_O_2(n, tuple)
|
||||
# else
|
||||
|
@ -23,13 +23,13 @@
|
||||
# /* BOOST_PP_TUPLE_INSERT */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_INSERT(tuple, i, elem) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_INSERT(BOOST_PP_TUPLE_TO_ARRAY(tuple), i, elem)) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_INSERT(BOOST_PP_TUPLE_TO_ARRAY(tuple), i, elem)) \
|
||||
/**/
|
||||
#
|
||||
# /* BOOST_PP_TUPLE_INSERT_D */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_INSERT_D(d, tuple, i, elem) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_INSERT_D(d, BOOST_PP_TUPLE_TO_ARRAY(tuple), i, elem)) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_INSERT_D(d, BOOST_PP_TUPLE_TO_ARRAY(tuple), i, elem)) \
|
||||
/**/
|
||||
#
|
||||
# endif // BOOST_PP_VARIADICS
|
||||
|
@ -26,17 +26,17 @@
|
||||
# /* BOOST_PP_TUPLE_POP_BACK */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK(tuple) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_POP_BACK_EXEC, \
|
||||
BOOST_PP_TUPLE_POP_BACK_RETURN \
|
||||
) \
|
||||
(tuple) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_POP_BACK_EXEC, \
|
||||
BOOST_PP_TUPLE_POP_BACK_RETURN \
|
||||
) \
|
||||
(tuple) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK_EXEC(tuple) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_BACK(BOOST_PP_TUPLE_TO_ARRAY(tuple))) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_BACK(BOOST_PP_TUPLE_TO_ARRAY(tuple))) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK_RETURN(tuple) tuple
|
||||
@ -44,17 +44,17 @@
|
||||
# /* BOOST_PP_TUPLE_POP_BACK_Z */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK_Z(z, tuple) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_POP_BACK_Z_EXEC, \
|
||||
BOOST_PP_TUPLE_POP_BACK_Z_RETURN \
|
||||
) \
|
||||
(z, tuple) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_POP_BACK_Z_EXEC, \
|
||||
BOOST_PP_TUPLE_POP_BACK_Z_RETURN \
|
||||
) \
|
||||
(z, tuple) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK_Z_EXEC(z, tuple) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_BACK_Z(z, BOOST_PP_TUPLE_TO_ARRAY(tuple))) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_BACK_Z(z, BOOST_PP_TUPLE_TO_ARRAY(tuple))) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_BACK_Z_RETURN(z, tuple) tuple
|
||||
|
@ -27,17 +27,17 @@
|
||||
# /* BOOST_PP_TUPLE_POP_FRONT */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_FRONT(tuple) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_POP_FRONT_EXEC, \
|
||||
BOOST_PP_TUPLE_POP_FRONT_RETURN \
|
||||
) \
|
||||
(tuple) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_POP_FRONT_EXEC, \
|
||||
BOOST_PP_TUPLE_POP_FRONT_RETURN \
|
||||
) \
|
||||
(tuple) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_FRONT_EXEC(tuple) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_FRONT(BOOST_PP_TUPLE_TO_ARRAY(tuple))) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_FRONT(BOOST_PP_TUPLE_TO_ARRAY(tuple))) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_FRONT_RETURN(tuple) tuple
|
||||
@ -45,17 +45,17 @@
|
||||
# /* BOOST_PP_TUPLE_POP_FRONT_Z */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_FRONT_Z(z, tuple) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_POP_FRONT_Z_EXEC, \
|
||||
BOOST_PP_TUPLE_POP_FRONT_Z_RETURN \
|
||||
) \
|
||||
(z, tuple) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_POP_FRONT_Z_EXEC, \
|
||||
BOOST_PP_TUPLE_POP_FRONT_Z_RETURN \
|
||||
) \
|
||||
(z, tuple) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_FRONT_Z_EXEC(z, tuple) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_FRONT_Z(z, BOOST_PP_TUPLE_TO_ARRAY(tuple))) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_POP_FRONT_Z(z, BOOST_PP_TUPLE_TO_ARRAY(tuple))) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_POP_FRONT_Z_RETURN(z, tuple) tuple
|
||||
|
@ -23,7 +23,7 @@
|
||||
# /* BOOST_PP_TUPLE_PUSH_BACK */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_PUSH_BACK(tuple, elem) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_PUSH_BACK(BOOST_PP_TUPLE_TO_ARRAY(tuple), elem)) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_PUSH_BACK(BOOST_PP_TUPLE_TO_ARRAY(tuple), elem)) \
|
||||
/**/
|
||||
#
|
||||
# endif // BOOST_PP_VARIADICS
|
||||
|
@ -24,7 +24,7 @@
|
||||
# /* BOOST_PP_TUPLE_PUSH_FRONT */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_PUSH_FRONT(tuple, elem) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_PUSH_FRONT(BOOST_PP_TUPLE_TO_ARRAY(tuple), elem)) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_PUSH_FRONT(BOOST_PP_TUPLE_TO_ARRAY(tuple), elem)) \
|
||||
/**/
|
||||
#
|
||||
# endif // BOOST_PP_VARIADICS
|
||||
|
@ -22,10 +22,10 @@
|
||||
# /* BOOST_PP_REM */
|
||||
#
|
||||
# if BOOST_PP_VARIADICS
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
/* To be used internally when __VA_ARGS__ could be empty ( or is a single element ) */
|
||||
# define BOOST_PP_REM_CAT(...) BOOST_PP_CAT(__VA_ARGS__,)
|
||||
# endif
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
/* To be used internally when __VA_ARGS__ could be empty ( or is a single element ) */
|
||||
# define BOOST_PP_REM_CAT(...) BOOST_PP_CAT(__VA_ARGS__,)
|
||||
# endif
|
||||
# define BOOST_PP_REM(...) __VA_ARGS__
|
||||
# else
|
||||
# define BOOST_PP_REM(x) x
|
||||
@ -37,10 +37,10 @@
|
||||
VC++8.0 cannot handle the variadic version of BOOST_PP_TUPLE_REM(size)
|
||||
*/
|
||||
# if BOOST_PP_VARIADICS && !(BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400)
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
/* To be used internally when the size could be 0 ( or 1 ) */
|
||||
# define BOOST_PP_TUPLE_REM_CAT(size) BOOST_PP_REM_CAT
|
||||
# endif
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
/* To be used internally when the size could be 0 ( or 1 ) */
|
||||
# define BOOST_PP_TUPLE_REM_CAT(size) BOOST_PP_REM_CAT
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_REM(size) BOOST_PP_REM
|
||||
# else
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||
@ -124,10 +124,10 @@
|
||||
# define BOOST_PP_TUPLE_REM_CTOR(...) BOOST_PP_TUPLE_REM_CTOR_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_REM_CTOR_O_, __VA_ARGS__), (__VA_ARGS__))
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_I(m, args) BOOST_PP_TUPLE_REM_CTOR_II(m, args)
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_II(m, args) BOOST_PP_CAT(m ## args,)
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_EXPAND(BOOST_PP_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) tuple)
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_EXPAND(BOOST_PP_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) tuple)
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_REM_CTOR(...) BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_REM_CTOR_O_, __VA_ARGS__)(__VA_ARGS__)
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_REM tuple
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_REM tuple
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_2(size, tuple) BOOST_PP_TUPLE_REM_CTOR_O_1(tuple)
|
||||
# else
|
||||
|
@ -26,17 +26,17 @@
|
||||
# /* BOOST_PP_TUPLE_REMOVE */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_REMOVE(tuple, i) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_REMOVE_EXEC, \
|
||||
BOOST_PP_TUPLE_REMOVE_RETURN \
|
||||
) \
|
||||
(tuple, i) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER(BOOST_PP_TUPLE_SIZE(tuple),1), \
|
||||
BOOST_PP_TUPLE_REMOVE_EXEC, \
|
||||
BOOST_PP_TUPLE_REMOVE_RETURN \
|
||||
) \
|
||||
(tuple, i) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_REMOVE_EXEC(tuple, i) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_REMOVE(BOOST_PP_TUPLE_TO_ARRAY(tuple), i)) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_REMOVE(BOOST_PP_TUPLE_TO_ARRAY(tuple), i)) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_REMOVE_RETURN(tuple, i) tuple
|
||||
@ -44,17 +44,17 @@
|
||||
# /* BOOST_PP_TUPLE_REMOVE_D */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_REMOVE_D(d, tuple, i) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER_D(d, BOOST_PP_TUPLE_SIZE(tuple), 1), \
|
||||
BOOST_PP_TUPLE_REMOVE_D_EXEC, \
|
||||
BOOST_PP_TUPLE_REMOVE_D_RETURN \
|
||||
) \
|
||||
(d, tuple, i) \
|
||||
BOOST_PP_IIF \
|
||||
( \
|
||||
BOOST_PP_GREATER_D(d, BOOST_PP_TUPLE_SIZE(tuple), 1), \
|
||||
BOOST_PP_TUPLE_REMOVE_D_EXEC, \
|
||||
BOOST_PP_TUPLE_REMOVE_D_RETURN \
|
||||
) \
|
||||
(d, tuple, i) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_REMOVE_D_EXEC(d, tuple, i) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_REMOVE_D(d, BOOST_PP_TUPLE_TO_ARRAY(tuple), i)) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_REMOVE_D(d, BOOST_PP_TUPLE_TO_ARRAY(tuple), i)) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_TUPLE_REMOVE_D_RETURN(d, tuple, i) tuple
|
||||
|
@ -23,13 +23,13 @@
|
||||
# /* BOOST_PP_TUPLE_REPLACE */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_REPLACE(tuple, i, elem) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_REPLACE(BOOST_PP_TUPLE_TO_ARRAY(tuple), i, elem)) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_REPLACE(BOOST_PP_TUPLE_TO_ARRAY(tuple), i, elem)) \
|
||||
/**/
|
||||
#
|
||||
# /* BOOST_PP_TUPLE_REPLACE_D */
|
||||
#
|
||||
# define BOOST_PP_TUPLE_REPLACE_D(d, tuple, i, elem) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_REPLACE_D(d, BOOST_PP_TUPLE_TO_ARRAY(tuple), i, elem)) \
|
||||
BOOST_PP_ARRAY_TO_TUPLE(BOOST_PP_ARRAY_REPLACE_D(d, BOOST_PP_TUPLE_TO_ARRAY(tuple), i, elem)) \
|
||||
/**/
|
||||
#
|
||||
# endif // BOOST_PP_VARIADICS
|
||||
|
@ -28,10 +28,10 @@
|
||||
# define BOOST_PP_TUPLE_REVERSE(...) BOOST_PP_TUPLE_REVERSE_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_REVERSE_O_, __VA_ARGS__), (__VA_ARGS__))
|
||||
# define BOOST_PP_TUPLE_REVERSE_I(m, args) BOOST_PP_TUPLE_REVERSE_II(m, args)
|
||||
# define BOOST_PP_TUPLE_REVERSE_II(m, args) BOOST_PP_CAT(m ## args,)
|
||||
# define BOOST_PP_TUPLE_REVERSE_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_REVERSE_, BOOST_PP_TUPLE_SIZE(tuple)) tuple
|
||||
# define BOOST_PP_TUPLE_REVERSE_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_REVERSE_, BOOST_PP_TUPLE_SIZE(tuple)) tuple
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_REVERSE(...) BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_REVERSE_O_, __VA_ARGS__)(__VA_ARGS__)
|
||||
# define BOOST_PP_TUPLE_REVERSE_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_REVERSE_, BOOST_PP_VARIADIC_SIZE tuple) tuple
|
||||
# define BOOST_PP_TUPLE_REVERSE_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_REVERSE_, BOOST_PP_VARIADIC_SIZE tuple) tuple
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_REVERSE_O_2(size, tuple) BOOST_PP_TUPLE_REVERSE_O_1(tuple)
|
||||
# else
|
||||
|
@ -28,10 +28,10 @@
|
||||
# define BOOST_PP_TUPLE_TO_LIST(...) BOOST_PP_TUPLE_TO_LIST_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_TO_LIST_O_, __VA_ARGS__), (__VA_ARGS__))
|
||||
# define BOOST_PP_TUPLE_TO_LIST_I(m, args) BOOST_PP_TUPLE_TO_LIST_II(m, args)
|
||||
# define BOOST_PP_TUPLE_TO_LIST_II(m, args) BOOST_PP_CAT(m ## args,)
|
||||
# define BOOST_PP_TUPLE_TO_LIST_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_LIST_, BOOST_PP_TUPLE_SIZE(tuple)) tuple
|
||||
# define BOOST_PP_TUPLE_TO_LIST_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_LIST_, BOOST_PP_TUPLE_SIZE(tuple)) tuple
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_TO_LIST(...) BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_TO_LIST_O_, __VA_ARGS__)(__VA_ARGS__)
|
||||
# define BOOST_PP_TUPLE_TO_LIST_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_LIST_, BOOST_PP_VARIADIC_SIZE tuple) tuple
|
||||
# define BOOST_PP_TUPLE_TO_LIST_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_LIST_, BOOST_PP_VARIADIC_SIZE tuple) tuple
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_TO_LIST_O_2(size, tuple) BOOST_PP_TUPLE_TO_LIST_O_1(tuple)
|
||||
# else
|
||||
|
@ -26,10 +26,10 @@
|
||||
# define BOOST_PP_TUPLE_TO_SEQ(...) BOOST_PP_TUPLE_TO_SEQ_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_TO_SEQ_O_, __VA_ARGS__), (__VA_ARGS__))
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_I(m, args) BOOST_PP_TUPLE_TO_SEQ_II(m, args)
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_II(m, args) BOOST_PP_CAT(m ## args,)
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_SEQ_, BOOST_PP_TUPLE_SIZE(tuple)) tuple
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_SEQ_, BOOST_PP_TUPLE_SIZE(tuple)) tuple
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_TO_SEQ(...) BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_TO_SEQ_O_, __VA_ARGS__)(__VA_ARGS__)
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_SEQ_, BOOST_PP_VARIADIC_SIZE tuple) tuple
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_O_1(tuple) BOOST_PP_CAT(BOOST_PP_TUPLE_TO_SEQ_, BOOST_PP_VARIADIC_SIZE tuple) tuple
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_TO_SEQ_O_2(size, tuple) BOOST_PP_TUPLE_TO_SEQ_O_1(tuple)
|
||||
# else
|
||||
|
@ -14,6 +14,7 @@
|
||||
# define BOOST_PREPROCESSOR_VARIADIC_HPP
|
||||
#
|
||||
# include <boost/preprocessor/variadic/elem.hpp>
|
||||
# include <boost/preprocessor/variadic/has_opt.hpp>
|
||||
# include <boost/preprocessor/variadic/size.hpp>
|
||||
# include <boost/preprocessor/variadic/to_array.hpp>
|
||||
# include <boost/preprocessor/variadic/to_list.hpp>
|
||||
|
39
include/boost/preprocessor/variadic/detail/has_opt.hpp
Normal file
39
include/boost/preprocessor/variadic/detail/has_opt.hpp
Normal file
@ -0,0 +1,39 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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) *
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_VARIADIC_DETAIL_HAS_OPT_HPP
|
||||
# define BOOST_PREPROCESSOR_VARIADIC_DETAIL_HAS_OPT_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
# if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L
|
||||
#
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_FUNCTION(...) \
|
||||
__VA_OPT__(,) , 1, 0 \
|
||||
/**/
|
||||
#
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM0(e0, ...) BOOST_PP_CAT(BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0,__VA_ARGS__),)
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM2(e0, ...) BOOST_PP_CAT(BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0,__VA_ARGS__),)
|
||||
# else
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM0(e0, ...) BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0,__VA_ARGS__)
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM2(e0, ...) BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0,__VA_ARGS__)
|
||||
# endif
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM_0(e0, ...) e0
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT_ELEM_2(e0, e1, e2, ...) e2
|
||||
#
|
||||
# endif
|
||||
#
|
||||
# endif
|
@ -20,9 +20,9 @@
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/facilities/is_1.hpp>
|
||||
# include <boost/preprocessor/variadic/size.hpp>
|
||||
# define BOOST_PP_VARIADIC_IS_SINGLE_RETURN(sr,nsr,...) \
|
||||
BOOST_PP_IIF(BOOST_PP_IS_1(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__)),sr,nsr) \
|
||||
/**/
|
||||
# define BOOST_PP_VARIADIC_IS_SINGLE_RETURN(sr,nsr,...) \
|
||||
BOOST_PP_IIF(BOOST_PP_IS_1(BOOST_PP_VARIADIC_SIZE(__VA_ARGS__)),sr,nsr) \
|
||||
/**/
|
||||
# endif /* BOOST_PP_VARIADICS && BOOST_PP_VARIADICS_MSVC */
|
||||
#
|
||||
# endif /* BOOST_PREPROCESSOR_VARIADIC_DETAIL_IS_SINGLE_RETURN_HPP */
|
||||
|
28
include/boost/preprocessor/variadic/has_opt.hpp
Normal file
28
include/boost/preprocessor/variadic/has_opt.hpp
Normal file
@ -0,0 +1,28 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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) *
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_PREPROCESSOR_VARIADIC_HAS_OPT_HPP
|
||||
# define BOOST_PREPROCESSOR_VARIADIC_HAS_OPT_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
# /* BOOST_PP_VARIADIC_HAS_OPT */
|
||||
#
|
||||
# if BOOST_PP_VARIADICS && defined(__cplusplus) && __cplusplus > 201703L
|
||||
# include <boost/preprocessor/variadic/detail/has_opt.hpp>
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT() \
|
||||
BOOST_PP_VARIADIC_HAS_OPT_ELEM2(BOOST_PP_VARIADIC_HAS_OPT_FUNCTION(?),) \
|
||||
/**/
|
||||
# else
|
||||
# define BOOST_PP_VARIADIC_HAS_OPT() 0
|
||||
# endif
|
||||
#
|
||||
# endif
|
@ -23,7 +23,11 @@
|
||||
# define BOOST_PP_WSTRINGIZE_OO(par) BOOST_PP_WSTRINGIZE_I ## par
|
||||
# endif
|
||||
#
|
||||
#if BOOST_PP_VARIADICS
|
||||
# define BOOST_PP_WSTRINGIZE_I(...) BOOST_PP_WSTRINGIZE_II(#__VA_ARGS__)
|
||||
#else
|
||||
# define BOOST_PP_WSTRINGIZE_I(text) BOOST_PP_WSTRINGIZE_II(#text)
|
||||
#endif
|
||||
# define BOOST_PP_WSTRINGIZE_II(str) L ## str
|
||||
#
|
||||
# endif
|
||||
|
33
test/CMakeLists.txt
Normal file
33
test/CMakeLists.txt
Normal file
@ -0,0 +1,33 @@
|
||||
# Copyright 2018, 2019 Peter Dimov
|
||||
# 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(BoostTest OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
|
||||
|
||||
if(NOT HAVE_BOOST_TEST)
|
||||
return()
|
||||
endif()
|
||||
|
||||
enable_language(C)
|
||||
|
||||
set(tests_common arithmetic array comparison control debug facilities list logical punctuation selection seq slot stringize tuple variadic isempty)
|
||||
set(tests_c ${tests_common})
|
||||
set(tests_cpp ${tests_common} iteration repetition quick)
|
||||
|
||||
set(BOOST_TEST_LINK_LIBRARIES Boost::preprocessor)
|
||||
|
||||
include_directories(../../..) # for `include <libs/preprocessor/...>` to work
|
||||
|
||||
foreach(test IN LISTS tests_c)
|
||||
|
||||
boost_test(TYPE compile SOURCES ${test}.c)
|
||||
boost_test(TYPE compile NAME ${test}_c_nvm SOURCES ${test}.c COMPILE_DEFINITIONS BOOST_PP_VARIADICS=0)
|
||||
|
||||
endforeach()
|
||||
|
||||
foreach(test IN LISTS tests_cpp)
|
||||
|
||||
boost_test(TYPE compile SOURCES ${test}.cpp)
|
||||
boost_test(TYPE compile NAME ${test}_cpp_nvm SOURCES ${test}.cpp COMPILE_DEFINITIONS BOOST_PP_VARIADICS=0)
|
||||
|
||||
endforeach()
|
145
test/Jamfile.v2
145
test/Jamfile.v2
@ -3,6 +3,7 @@
|
||||
#~ (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import testing ;
|
||||
import cast ;
|
||||
|
||||
project preprocessor_tests : requirements <warnings>on
|
||||
<toolset>gcc-4.3.0:<warnings>all
|
||||
@ -21,35 +22,36 @@ alias preprocessor : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>3.4
|
||||
;
|
||||
|
||||
|
||||
alias preprocessor : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>4.1
|
||||
;
|
||||
|
||||
|
||||
alias preprocessor : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>4.2
|
||||
;
|
||||
|
||||
|
||||
alias preprocessor
|
||||
:
|
||||
[ compile arithmetic.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile array.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile comparison.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile control.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile debug.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile facilities.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile iteration.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile list.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile logical.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile punctuation.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile repetition.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile selection.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile seq.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile slot.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile tuple.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile variadic.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile arithmetic.cpp ]
|
||||
[ compile array.cpp ]
|
||||
[ compile comparison.cpp ]
|
||||
[ compile control.cpp ]
|
||||
[ compile debug.cpp ]
|
||||
[ compile facilities.cpp ]
|
||||
[ compile iteration.cpp ]
|
||||
[ compile list.cpp ]
|
||||
[ compile logical.cpp ]
|
||||
[ compile punctuation.cpp ]
|
||||
[ compile repetition.cpp ]
|
||||
[ compile selection.cpp ]
|
||||
[ compile seq.cpp ]
|
||||
[ compile slot.cpp ]
|
||||
[ compile stringize.cpp ]
|
||||
[ compile tuple.cpp ]
|
||||
[ compile variadic.cpp ]
|
||||
;
|
||||
|
||||
alias preprocessor_nvm
|
||||
@ -67,65 +69,70 @@ alias preprocessor_nvm
|
||||
[ compile selection.cpp : <define>BOOST_PP_VARIADICS=0 : selection_nvm ]
|
||||
[ compile seq.cpp : <define>BOOST_PP_VARIADICS=0 : seq_nvm ]
|
||||
[ compile slot.cpp : <define>BOOST_PP_VARIADICS=0 : slot_nvm ]
|
||||
[ compile stringize.cpp : <define>BOOST_PP_VARIADICS=0 : stringize_nvm ]
|
||||
[ compile tuple.cpp : <define>BOOST_PP_VARIADICS=0 : tuple_nvm ]
|
||||
;
|
||||
|
||||
alias preprocessor_c
|
||||
:
|
||||
[ compile arithmetic.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: arithmetic_c
|
||||
]
|
||||
[ compile array.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: array_c
|
||||
]
|
||||
[ compile comparison.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: comparison_c
|
||||
]
|
||||
[ compile control.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: control_c
|
||||
]
|
||||
[ compile debug.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: debug_c
|
||||
]
|
||||
[ compile facilities.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: facilities_c
|
||||
]
|
||||
[ compile list.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: list_c
|
||||
]
|
||||
[ compile logical.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: logical_c
|
||||
]
|
||||
[ compile punctuation.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: punctuation_c
|
||||
]
|
||||
[ compile selection.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: selection_c
|
||||
]
|
||||
[ compile seq.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: seq_c
|
||||
]
|
||||
[ compile slot.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: slot_c
|
||||
]
|
||||
[ compile stringize.c
|
||||
:
|
||||
: stringize_c
|
||||
]
|
||||
[ compile tuple.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: tuple_c
|
||||
]
|
||||
[ compile variadic.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: variadic_c
|
||||
]
|
||||
;
|
||||
@ -133,115 +140,108 @@ alias preprocessor_c
|
||||
alias preprocessor_c_nvm
|
||||
:
|
||||
[ compile arithmetic.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
: arithmetic_c_nvm
|
||||
]
|
||||
[ compile array.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
: array_c_nvm
|
||||
]
|
||||
[ compile comparison.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: comparison_c_nvm
|
||||
]
|
||||
[ compile control.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: control_c_nvm
|
||||
]
|
||||
[ compile debug.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: debug_c_nvm
|
||||
]
|
||||
[ compile facilities.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: facilities_c_nvm
|
||||
]
|
||||
[ compile list.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: list_c_nvm
|
||||
]
|
||||
[ compile logical.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: logical_c_nvm
|
||||
]
|
||||
[ compile selection.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: selection_c_nvm
|
||||
]
|
||||
[ compile seq.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: seq_c_nvm
|
||||
]
|
||||
[ compile slot.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: slot_c_nvm
|
||||
]
|
||||
[ compile stringize.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
: stringize_c_nvm
|
||||
]
|
||||
[ compile tuple.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: tuple_c_nvm
|
||||
]
|
||||
;
|
||||
|
||||
|
||||
alias preprocessor_isempty : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>3.4
|
||||
;
|
||||
|
||||
|
||||
alias preprocessor_isempty : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>4.1
|
||||
;
|
||||
|
||||
|
||||
alias preprocessor_isempty : :
|
||||
<toolset>gcc
|
||||
<toolset-gcc:version>4.2
|
||||
;
|
||||
|
||||
|
||||
alias preprocessor_isempty
|
||||
:
|
||||
[ compile isempty.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile-fail isempty_variadic_standard_failure.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile-fail isempty_variadic_standard_failure2.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang-linux:<cxxflags>-std=c++0x ]
|
||||
[ compile isempty.cpp ]
|
||||
[ compile checkempty.cpp ]
|
||||
[ compile-fail isempty_variadic_standard_failure.cpp : <define>BOOST_PP_VARIADICS=1 ]
|
||||
[ compile-fail isempty_variadic_standard_failure2.cpp : <define>BOOST_PP_VARIADICS=1 ]
|
||||
[ compile vaopt.cpp ]
|
||||
;
|
||||
|
||||
|
||||
alias preprocessor_isempty_nvm
|
||||
:
|
||||
[ compile isempty.cpp : <define>BOOST_PP_VARIADICS=0 : isempty_nvm ]
|
||||
[ compile isempty.cpp : <define>BOOST_PP_VARIADICS=0 : isempty_nvm ]
|
||||
;
|
||||
|
||||
|
||||
alias preprocessor_isempty_c
|
||||
:
|
||||
[ compile isempty.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
:
|
||||
: isempty_c
|
||||
]
|
||||
[ compile-fail isempty_variadic_standard_failure.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: <define>BOOST_PP_VARIADICS=1
|
||||
: isempty_variadic_standard_failure_c
|
||||
]
|
||||
[ compile-fail isempty_variadic_standard_failure2.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: <define>BOOST_PP_VARIADICS=1
|
||||
: isempty_variadic_standard_failure2_c
|
||||
]
|
||||
;
|
||||
|
||||
|
||||
alias preprocessor_isempty_c_nvm
|
||||
:
|
||||
[ compile isempty.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: isempty_c_nvm
|
||||
]
|
||||
;
|
||||
@ -250,3 +250,24 @@ alias preprocessor_config
|
||||
:
|
||||
[ run config_info.cpp ]
|
||||
;
|
||||
|
||||
alias test_clang_cuda
|
||||
:
|
||||
[ compile [ cast _ cpp : clang_cuda.cu ]
|
||||
: <cxxflags>-nocudalib
|
||||
<cxxflags>-nocudainc
|
||||
<cxxflags>"-x cuda"
|
||||
: clang_cuda_cu
|
||||
]
|
||||
;
|
||||
|
||||
explicit test_clang_cuda ;
|
||||
|
||||
alias test_iso
|
||||
:
|
||||
[ run cpp_standard.cpp ]
|
||||
;
|
||||
|
||||
explicit test_iso ;
|
||||
|
||||
explicit compile quick.cpp ; # "Quick" test (for CI)
|
||||
|
12
test/checkempty.cpp
Normal file
12
test/checkempty.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/checkempty.cxx>
|
61
test/checkempty.cxx
Normal file
61
test/checkempty.cxx
Normal file
@ -0,0 +1,61 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
# include <boost/preprocessor/facilities/check_empty.hpp>
|
||||
|
||||
# if BOOST_PP_VARIADIC_HAS_OPT()
|
||||
|
||||
# include <boost/preprocessor/facilities/empty.hpp>
|
||||
|
||||
#define DATA
|
||||
#define OBJECT OBJECT2
|
||||
#define OBJECT2
|
||||
#define FUNC(x) FUNC2(x)
|
||||
#define FUNC2(x)
|
||||
#define FUNC_GEN() ()
|
||||
#define FUNC_GEN2(x) ()
|
||||
#define FUNC_GEN3() (&)
|
||||
#define FUNC_GEN4(x) (y)
|
||||
#define FUNC_GEN5() (y,z)
|
||||
#define FUNC_GEN6() anything
|
||||
#define FUNC_GEN7(x) anything
|
||||
#define FUNC_GEN8(x,y) (1,2,3)
|
||||
#define FUNC_GEN9(x,y,z) anything
|
||||
#define FUNC_GEN10(x) (y) data
|
||||
#define NAME &name
|
||||
#define ATUPLE (atuple)
|
||||
#define ATUPLE_PLUS (atuple) data
|
||||
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN2) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN3) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN4) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN5) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN8) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN9) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN10) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(DATA BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(x BOOST_PP_EMPTY()) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(OBJECT BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC(z) BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN6) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(FUNC_GEN7) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(NAME) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(ATUPLE) == 0 END
|
||||
BEGIN BOOST_PP_CHECK_EMPTY(ATUPLE_PLUS) == 0 END
|
||||
|
||||
# else
|
||||
|
||||
BEGIN 1 == 1 END
|
||||
|
||||
# endif
|
26
test/clang_cuda.cu
Normal file
26
test/clang_cuda.cu
Normal file
@ -0,0 +1,26 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/test_macro.h>
|
||||
|
||||
#if defined(__clang__) && defined(__CUDACC__) && defined(__CUDA__)
|
||||
|
||||
BEGIN BOOST_PP_VARIADICS == 1 END
|
||||
|
||||
#else
|
||||
|
||||
BEGIN 0 == 1 END
|
||||
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
return 0;
|
||||
}
|
17
test/cmake_install_test/CMakeLists.txt
Normal file
17
test/cmake_install_test/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright 2018, 2019 Peter Dimov
|
||||
# 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
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(cmake_install_test LANGUAGES CXX)
|
||||
|
||||
find_package(boost_preprocessor REQUIRED)
|
||||
|
||||
add_executable(quick ../quick.cpp)
|
||||
target_link_libraries(quick Boost::preprocessor)
|
||||
|
||||
enable_testing()
|
||||
add_test(quick quick)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
17
test/cmake_subdir_test/CMakeLists.txt
Normal file
17
test/cmake_subdir_test/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright 2018, 2019 Peter Dimov
|
||||
# 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
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(cmake_subdir_test LANGUAGES CXX)
|
||||
|
||||
add_subdirectory(../.. boostorg/preprocessor)
|
||||
|
||||
add_executable(quick ../quick.cpp)
|
||||
target_link_libraries(quick Boost::preprocessor)
|
||||
|
||||
enable_testing()
|
||||
add_test(quick quick)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
@ -1,7 +1,19 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014,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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <string.h>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
#include <boost/preprocessor/variadic/has_opt.hpp>
|
||||
|
||||
static unsigned int indent = 4;
|
||||
static unsigned int width = 40;
|
||||
@ -82,6 +94,7 @@ void print_macros()
|
||||
PRINT_MACRO(BOOST_PP_CONFIG_FLAGS());
|
||||
PRINT_MACRO(BOOST_PP_VARIADICS);
|
||||
PRINT_MACRO(BOOST_PP_VARIADICS_MSVC);
|
||||
PRINT_MACRO(BOOST_PP_VARIADIC_HAS_OPT());
|
||||
}
|
||||
|
||||
int main()
|
||||
|
551
test/cpp_standard.cpp
Normal file
551
test/cpp_standard.cpp
Normal file
@ -0,0 +1,551 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <string>
|
||||
#include <boost/preprocessor/config/config.hpp>
|
||||
|
||||
static unsigned int indent = 4;
|
||||
static unsigned int width = 90;
|
||||
|
||||
using std::cout;
|
||||
using std::istream;
|
||||
|
||||
void print_separator()
|
||||
{
|
||||
std::cout <<
|
||||
"\n\n*********************************************************************\n\n";
|
||||
}
|
||||
|
||||
std::string remove_spaces(const std::string ss)
|
||||
{
|
||||
|
||||
bool inquotes(false);
|
||||
bool escape(false);
|
||||
char qchar;
|
||||
int len(static_cast<int>(ss.length()));
|
||||
|
||||
std::string ret;
|
||||
|
||||
for (int i = 0; i < len; ++i)
|
||||
{
|
||||
|
||||
char ch(ss[i]);
|
||||
|
||||
if (inquotes)
|
||||
{
|
||||
if (escape)
|
||||
{
|
||||
escape = false;
|
||||
}
|
||||
else if (ch == '\\')
|
||||
{
|
||||
escape = true;
|
||||
}
|
||||
else if (ch == qchar)
|
||||
{
|
||||
inquotes = false;
|
||||
}
|
||||
ret.push_back(ch);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ch == '\'' || ch == '"')
|
||||
{
|
||||
inquotes = true;
|
||||
qchar = ch;
|
||||
ret.push_back(ch);
|
||||
}
|
||||
else if (ch != ' ')
|
||||
{
|
||||
ret.push_back(ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int print_macro(const std::string name,const std::string expected, const std::string expansion)
|
||||
{
|
||||
int bret(0);
|
||||
const std::string sg("Success: ");
|
||||
const std::string sb("Failure: ");
|
||||
for(unsigned i = 0; i < indent; ++i) std::cout.put(' ');
|
||||
if (name == expansion)
|
||||
{
|
||||
if (expected == expansion)
|
||||
{
|
||||
std::cout << sg;
|
||||
std::cout << std::setw(width);
|
||||
cout.setf(istream::left, istream::adjustfield);
|
||||
std::cout << name;
|
||||
std::cout << " [no value]\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << sb;
|
||||
std::cout << std::setw(width);
|
||||
cout.setf(istream::left, istream::adjustfield);
|
||||
std::cout << name;
|
||||
std::cout << " [no value]: ";
|
||||
std::cout << " [expected]: ";
|
||||
std::cout << expected << "\n";
|
||||
bret = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
std::string sexpected(remove_spaces(expected));
|
||||
std::string sexpansion(remove_spaces(expansion));
|
||||
|
||||
if (sexpected == sexpansion)
|
||||
{
|
||||
std::cout << sg;
|
||||
std::cout << std::setw(width);
|
||||
cout.setf(istream::left, istream::adjustfield);
|
||||
std::cout << name;
|
||||
std::cout << expansion << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << sb;
|
||||
std::cout << std::setw(width);
|
||||
cout.setf(istream::left, istream::adjustfield);
|
||||
std::cout << name;
|
||||
std::cout << expansion;
|
||||
std::cout << " [expected]: ";
|
||||
std::cout << expected << "\n";
|
||||
bret = 1;
|
||||
}
|
||||
}
|
||||
return bret;
|
||||
}
|
||||
|
||||
#if !BOOST_PP_VARIADICS
|
||||
|
||||
#define STRINGIZE(arg) # arg
|
||||
|
||||
#define PRINT_MACRO_RESULTS(X,exp) print_macro(std::string(# X), std::string(# exp), std::string(STRINGIZE(X)))
|
||||
#define PRINT_MACRO(x) std::string(# x)
|
||||
#define PRINT_EXPECTED(x) std::string(# x)
|
||||
#define PRINT_EXPANSION(x) std::string(STRINGIZE(x))
|
||||
|
||||
#else
|
||||
|
||||
#define STRINGIZE(...) # __VA_ARGS__
|
||||
|
||||
#define PRINT_MACRO_RESULTS(X,...) print_macro(std::string(# X), std::string(# __VA_ARGS__), std::string(STRINGIZE(X)))
|
||||
#define PRINT_MACRO(...) std::string(# __VA_ARGS__)
|
||||
#define PRINT_EXPECTED(...) std::string(# __VA_ARGS__)
|
||||
#define PRINT_EXPANSION(...) std::string(STRINGIZE(__VA_ARGS__))
|
||||
|
||||
#endif
|
||||
|
||||
#if __cplusplus > 201703L
|
||||
|
||||
int print_macros_common_c20()
|
||||
{
|
||||
|
||||
int bret = 0;
|
||||
|
||||
#define LPAREN() (
|
||||
#define G(Q) 42
|
||||
#define F(R, X, ...) __VA_OPT__(G R X) )
|
||||
|
||||
// int x = F(LPAREN(), 0, <:-);
|
||||
|
||||
// replaced by
|
||||
|
||||
// int x = 42;
|
||||
|
||||
bret += PRINT_MACRO_RESULTS(int x = F(LPAREN(), 0, <:-);,int x = 42;);
|
||||
|
||||
#undef LPAREN
|
||||
#undef G
|
||||
#undef F
|
||||
|
||||
#define F(...) f(0 __VA_OPT__(,) __VA_ARGS__)
|
||||
#define G(X, ...) f(0, X __VA_OPT__(,) __VA_ARGS__)
|
||||
#define SDEF(sname, ...) S sname __VA_OPT__(= { __VA_ARGS__ })
|
||||
#define EMP
|
||||
|
||||
// F(a, b, c)
|
||||
// F()
|
||||
// F(EMP)
|
||||
|
||||
// replaced by
|
||||
|
||||
// f(0, a, b, c)
|
||||
// f(0)
|
||||
// f(0)
|
||||
|
||||
// G(a, b, c)
|
||||
// G(a, )
|
||||
// G(a)
|
||||
|
||||
// replaced by
|
||||
|
||||
// f(0, a, b, c)
|
||||
// f(0, a)
|
||||
// f(0, a)
|
||||
|
||||
// SDEF(foo);
|
||||
// SDEF(bar, 1, 2);
|
||||
|
||||
// replaced by
|
||||
|
||||
// S foo;
|
||||
// S bar = { 1, 2 };
|
||||
|
||||
bret += PRINT_MACRO_RESULTS(F(a, b, c),f(0, a, b, c));
|
||||
bret += PRINT_MACRO_RESULTS(F(),f(0));
|
||||
bret += PRINT_MACRO_RESULTS(F(EMP),f(0));
|
||||
bret += PRINT_MACRO_RESULTS(G(a, b, c),f(0, a, b, c));
|
||||
bret += PRINT_MACRO_RESULTS(G(a, ),f(0, a));
|
||||
bret += PRINT_MACRO_RESULTS(G(a),f(0, a));
|
||||
bret += PRINT_MACRO_RESULTS(SDEF(foo);,S foo;);
|
||||
bret += PRINT_MACRO_RESULTS(SDEF(bar, 1, 2);,S bar = { 1, 2 };);
|
||||
|
||||
#undef F
|
||||
#undef G
|
||||
#undef SDEF
|
||||
#undef EMP
|
||||
|
||||
#define H2(X, Y, ...) __VA_OPT__(X ## Y,) __VA_ARGS__
|
||||
#define H3(X, ...) #__VA_OPT__(X##X X##X)
|
||||
#define H4(X, ...) __VA_OPT__(a X ## X) ## b
|
||||
#define H5A(...) __VA_OPT__()/**/__VA_OPT__()
|
||||
#define H5B(X) a ## X ## b
|
||||
#define H5C(X) H5B(X)
|
||||
|
||||
// H2(a, b, c, d)
|
||||
|
||||
// replaced by
|
||||
|
||||
// ab, c, d
|
||||
|
||||
// H3(, 0)
|
||||
|
||||
// replaced by
|
||||
|
||||
// ""
|
||||
|
||||
// H4(, 1)
|
||||
|
||||
// replaced by
|
||||
|
||||
// a b
|
||||
|
||||
// H5C(H5A())
|
||||
|
||||
// replaced by
|
||||
|
||||
// ab
|
||||
|
||||
bret += PRINT_MACRO_RESULTS(H2(a, b, c, d),ab, c, d);
|
||||
bret += PRINT_MACRO_RESULTS(H3(, 0),"");
|
||||
bret += PRINT_MACRO_RESULTS(H4(, 1),a b);
|
||||
bret += PRINT_MACRO_RESULTS(H5C(H5A()),ab);
|
||||
|
||||
#undef H2
|
||||
#undef H3
|
||||
#undef H4
|
||||
#undef H5A
|
||||
#undef H5B
|
||||
#undef H5C
|
||||
|
||||
return bret;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int print_macros_common_1()
|
||||
{
|
||||
|
||||
int bret = 0;
|
||||
|
||||
#define x 3
|
||||
#define f(a) f(x * (a))
|
||||
#undef x
|
||||
|
||||
#define x 2
|
||||
#define g f
|
||||
#define z z[0]
|
||||
#define h g(~
|
||||
#define m(a) a(w)
|
||||
#define w 0,1
|
||||
#define t(a) a
|
||||
|
||||
// f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
|
||||
// g(x+(3,4)-w) | h 5) & m(f)^m(m);
|
||||
|
||||
// results in
|
||||
|
||||
// f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1);
|
||||
// f(2 * (2+(3,4)-0,1)) | f(2 * ( ~ 5)) & f(2 * (0,1))^m(0,1);
|
||||
|
||||
bret += PRINT_MACRO_RESULTS(f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);,f(2 * (y+1)) + f(2 * (f(2 * (z[0])))) % f(2 * (0)) + t(1););
|
||||
|
||||
#define PRINT_INPUT g(x+(3,4)-w) | h 5) & m(f)^m(m);
|
||||
|
||||
bret += print_macro
|
||||
(
|
||||
std::string("g(x+(3,4)-w) | h 5) & m(f)^m(m);"),
|
||||
PRINT_EXPECTED(f(2 * (2+(3,4)-0,1)) | f(2 * ( ~ 5)) & f(2 * (0,1))^m(0,1);),
|
||||
PRINT_EXPANSION(PRINT_INPUT)
|
||||
);
|
||||
|
||||
#undef PRINT_INPUT
|
||||
|
||||
#undef f
|
||||
#undef x
|
||||
#undef g
|
||||
#undef z
|
||||
#undef h
|
||||
#undef m
|
||||
#undef w
|
||||
#undef t
|
||||
|
||||
return bret;
|
||||
|
||||
}
|
||||
|
||||
int print_macros_common_4()
|
||||
{
|
||||
|
||||
int bret = 0;
|
||||
|
||||
#define str(s) # s
|
||||
#define xstr(s) str(s)
|
||||
#define debug(s, t) printf("x" # s "= %d, x" # t "= %s", x ## s, x ## t)
|
||||
#define INCFILE(n) vers ## n
|
||||
#define glue(a, b) a ## b
|
||||
#define xglue(a, b) glue(a, b)
|
||||
#define HIGHLOW "hello"
|
||||
#define LOW LOW ", world"
|
||||
|
||||
// debug(1, 2);
|
||||
// fputs(str(strncmp("abc\0d", "abc", <20>\4<>) // this goes away
|
||||
// == 0) str(: @\n), s);
|
||||
// #include xstr(INCFILE(2).h)
|
||||
// glue(HIGH, LOW);
|
||||
// xglue(HIGH, LOW)
|
||||
|
||||
// results in
|
||||
|
||||
// printf("x" "1" "= %d, x" "2" "= %s", x1, x2);
|
||||
// fputs("strncmp(\"abc\\0d\", \"abc\", <20>\\4<>) == 0" ": @\n", s);
|
||||
// #include "vers2.h" (after macro replacement, before file access)
|
||||
// "hello";
|
||||
// "hello" ", world"
|
||||
|
||||
bret += PRINT_MACRO_RESULTS(debug(1, 2);,printf("x" "1" "= %d, x" "2" "= %s", x1, x2););
|
||||
bret += print_macro
|
||||
(
|
||||
std::string("fputs(str(strncmp(\"abc\\0d\", \"abc\", '\\4') /* this goes away */== 0) str(: @\\n), s);"),
|
||||
PRINT_EXPECTED(fputs("strncmp(\"abc\\0d\", \"abc\", '\\4') == 0" ": @\n", s);),
|
||||
PRINT_EXPANSION(fputs(str(strncmp("abc\0d", "abc", '\4') /* this goes away */== 0) str(: @\n), s);)
|
||||
);
|
||||
bret += PRINT_MACRO_RESULTS(xstr(INCFILE(2).h),"vers2.h");
|
||||
bret += PRINT_MACRO_RESULTS(glue(HIGH, LOW);,"hello";);
|
||||
|
||||
#if __cplusplus <= 199711L
|
||||
|
||||
bret += print_macro
|
||||
(
|
||||
PRINT_MACRO(xglue(HIGH, LOW)),
|
||||
std::string("\"hello\" \", world\""),
|
||||
PRINT_EXPANSION(xglue(HIGH, LOW))
|
||||
);
|
||||
|
||||
#else
|
||||
|
||||
bret += PRINT_MACRO_RESULTS(xglue(HIGH, LOW),"hello" ", world");
|
||||
|
||||
#endif
|
||||
|
||||
#undef str
|
||||
#undef xstr
|
||||
#undef debug
|
||||
#undef INCFILE
|
||||
#undef glue
|
||||
#undef xglue
|
||||
#undef HIGHLOW
|
||||
#undef LOW
|
||||
|
||||
return bret;
|
||||
|
||||
}
|
||||
|
||||
int print_macros_common_2()
|
||||
{
|
||||
|
||||
int bret = 0;
|
||||
|
||||
#define hash_hash # ## #
|
||||
#define mkstr(a) # a
|
||||
#define in_between(a) mkstr(a)
|
||||
#define join(c, d) in_between(c hash_hash d)
|
||||
|
||||
// char p[] = join(x, y);
|
||||
|
||||
// equivalent to
|
||||
|
||||
// char p[] = "x ## y";
|
||||
|
||||
bret += PRINT_MACRO_RESULTS(char p[] = join(x, y);,char p[] = "x ## y";);
|
||||
|
||||
#undef hash_hash
|
||||
#undef mkstr
|
||||
#undef in_between
|
||||
#undef join
|
||||
|
||||
return bret;
|
||||
|
||||
}
|
||||
|
||||
#if BOOST_PP_VARIADICS && __cplusplus > 199711L
|
||||
|
||||
int print_macros_common_3()
|
||||
{
|
||||
|
||||
int bret = 0;
|
||||
|
||||
#define p() int
|
||||
#define q(x) x
|
||||
#define r(x,y) x ## y
|
||||
#define str(x) # x
|
||||
|
||||
// p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) };
|
||||
// char c[2][6] = { str(hello), str() };
|
||||
|
||||
// results in
|
||||
|
||||
// int i[] = { 1, 23, 4, 5, };
|
||||
// char c[2][6] = { "hello", "" };
|
||||
|
||||
bret += print_macro
|
||||
(
|
||||
PRINT_MACRO(p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) };),
|
||||
PRINT_EXPECTED(int i[] = { 1, 23, 4, 5, };),
|
||||
PRINT_EXPANSION(p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,) };)
|
||||
);
|
||||
bret += print_macro
|
||||
(
|
||||
PRINT_MACRO(char c[2][6] = { str(hello), str() };),
|
||||
PRINT_EXPECTED(char c[2][6] = { "hello", "" };),
|
||||
PRINT_EXPANSION(char c[2][6] = { str(hello), str() };)
|
||||
);
|
||||
|
||||
#undef p
|
||||
#undef q
|
||||
#undef r
|
||||
#undef str
|
||||
|
||||
bret += print_macros_common_4();
|
||||
|
||||
#define t(x,y,z) x ## y ## z
|
||||
|
||||
// int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), t(10,,), t(,11,), t(,,12), t(,,) };
|
||||
|
||||
// results in
|
||||
|
||||
// int j[] = { 123, 45, 67, 89, 10, 11, 12, };
|
||||
|
||||
bret += print_macro
|
||||
(
|
||||
PRINT_MACRO(int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), t(10,,), t(,11,), t(,,12), t(,,) };),
|
||||
PRINT_EXPECTED(int j[] = { 123, 45, 67, 89, 10, 11, 12, };),
|
||||
PRINT_EXPANSION(int j[] = { t(1,2,3), t(,4,5), t(6,,7), t(8,9,), t(10,,), t(,11,), t(,,12), t(,,) };)
|
||||
);
|
||||
|
||||
#undef t
|
||||
|
||||
#define debug(...) fprintf(stderr, __VA_ARGS__)
|
||||
#define showlist(...) puts(#__VA_ARGS__)
|
||||
#define report(test, ...) ((test) ? puts(#test) : printf(__VA_ARGS__))
|
||||
|
||||
// debug("Flag");
|
||||
// debug("X = %d\n", x);
|
||||
// showlist(The first, second, and third items.);
|
||||
// report(x>y, "x is %d but y is %d", x, y);
|
||||
|
||||
// results in
|
||||
|
||||
// fprintf(stderr, "Flag");
|
||||
// fprintf(stderr, "X = %d\n", x);
|
||||
// puts("The first, second, and third items.");
|
||||
// ((x>y) ? puts("x>y") : printf("x is %d but y is %d", x, y));
|
||||
|
||||
#define save_stderr stderr
|
||||
#undef stderr
|
||||
|
||||
bret += PRINT_MACRO_RESULTS(debug("Flag");,fprintf(stderr, "Flag"););
|
||||
bret += PRINT_MACRO_RESULTS(debug("X = %d\n", x);,fprintf(stderr, "X = %d\n", x););
|
||||
|
||||
#define stderr save_stderr
|
||||
|
||||
bret += PRINT_MACRO_RESULTS(showlist(The first, second, and third items.);,puts("The first, second, and third items."););
|
||||
bret += PRINT_MACRO_RESULTS(report(x>y, "x is %d but y is %d", x, y);,((x>y) ? puts("x>y") : printf("x is %d but y is %d", x, y)););
|
||||
|
||||
#undef debug
|
||||
#undef showlist
|
||||
#undef report
|
||||
|
||||
return bret;
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int print_macros()
|
||||
{
|
||||
int bret = 0;
|
||||
|
||||
print_separator();
|
||||
|
||||
std::cout << "__cplusplus = " << __cplusplus;
|
||||
|
||||
print_separator();
|
||||
|
||||
#define OBJ_LIKE (1-1)
|
||||
#define OBJ_LIKE /* white space */ (1-1) /* other */
|
||||
#define FTN_LIKE(a) ( a )
|
||||
#define FTN_LIKE( a )( /* note the white space */ a /* other stuff on this line */ )
|
||||
|
||||
#if !BOOST_PP_VARIADICS
|
||||
|
||||
bret += print_macros_common_1();
|
||||
bret += print_macros_common_4();
|
||||
|
||||
#elif __cplusplus <= 199711L
|
||||
|
||||
bret += print_macros_common_2();
|
||||
bret += print_macros_common_1();
|
||||
bret += print_macros_common_4();
|
||||
|
||||
#elif __cplusplus <= 201703L
|
||||
|
||||
bret += print_macros_common_2();
|
||||
bret += print_macros_common_1();
|
||||
bret += print_macros_common_3();
|
||||
|
||||
#else
|
||||
|
||||
bret += print_macros_common_c20();
|
||||
bret += print_macros_common_2();
|
||||
bret += print_macros_common_1();
|
||||
bret += print_macros_common_3();
|
||||
|
||||
#endif
|
||||
|
||||
print_separator();
|
||||
|
||||
return bret;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
return (print_macros());
|
||||
}
|
@ -38,7 +38,20 @@
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
#if BOOST_PP_VARIADICS_MSVC /* Testing the VC++ variadic version */
|
||||
# include <boost/preprocessor/variadic/has_opt.hpp>
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus > 201703L && BOOST_PP_VARIADIC_HAS_OPT()
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN2) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN3) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN4) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN5) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN8) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN9) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN10) == 0 END
|
||||
|
||||
#elif BOOST_PP_VARIADICS_MSVC /* Testing the VC++ variadic version */
|
||||
|
||||
/* INCORRECT */
|
||||
|
||||
|
@ -15,9 +15,19 @@
|
||||
#if BOOST_PP_VARIADICS && (BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()) && !BOOST_PP_VARIADICS_MSVC
|
||||
|
||||
#define FUNC_GEN8(x,y) (1,2,3)
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus > 201703L
|
||||
|
||||
# include <boost/preprocessor/variadic/has_opt.hpp>
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN8) == BOOST_PP_VARIADIC_HAS_OPT() END
|
||||
|
||||
#else
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN8) == 0 END
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
BEGIN 1 == 0 END
|
||||
|
@ -16,8 +16,18 @@
|
||||
|
||||
#define FUNC_GEN9(x,y,z) anything
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus > 201703L
|
||||
|
||||
# include <boost/preprocessor/variadic/has_opt.hpp>
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN9) == BOOST_PP_VARIADIC_HAS_OPT() END
|
||||
|
||||
#else
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN9) == 0 END
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
BEGIN 1 == 0 END
|
||||
|
43
test/quick.cpp
Normal file
43
test/quick.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
// Copyright 2002 Paul Mensonides
|
||||
// Copyright 2019 Peter Dimov
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// https://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#include <boost/preprocessor/comparison.hpp>
|
||||
#include "test_macro.h"
|
||||
|
||||
/* equality */
|
||||
|
||||
BEGIN BOOST_PP_EQUAL(2, 0) == 0 END
|
||||
BEGIN BOOST_PP_EQUAL(2, 2) == 1 END
|
||||
|
||||
/* inequality */
|
||||
|
||||
BEGIN BOOST_PP_NOT_EQUAL(2, 0) == 1 END
|
||||
BEGIN BOOST_PP_NOT_EQUAL(2, 2) == 0 END
|
||||
|
||||
/* less */
|
||||
|
||||
BEGIN BOOST_PP_LESS(2, 1) == 0 END
|
||||
BEGIN BOOST_PP_LESS(1, 2) == 1 END
|
||||
|
||||
/* less_equal */
|
||||
|
||||
BEGIN BOOST_PP_LESS_EQUAL(2, 1) == 0 END
|
||||
BEGIN BOOST_PP_LESS_EQUAL(1, 2) == 1 END
|
||||
BEGIN BOOST_PP_LESS_EQUAL(2, 2) == 1 END
|
||||
|
||||
/* greater */
|
||||
|
||||
BEGIN BOOST_PP_GREATER(2, 1) == 1 END
|
||||
BEGIN BOOST_PP_GREATER(1, 2) == 0 END
|
||||
|
||||
/* greater_equal */
|
||||
|
||||
BEGIN BOOST_PP_GREATER_EQUAL(2, 1) == 1 END
|
||||
BEGIN BOOST_PP_GREATER_EQUAL(1, 2) == 0 END
|
||||
BEGIN BOOST_PP_GREATER_EQUAL(2, 2) == 1 END
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
78
test/seq.cxx
78
test/seq.cxx
@ -35,46 +35,46 @@
|
||||
# define SEQ (4)(1)(5)(2)
|
||||
|
||||
# define SEQ_100 \
|
||||
(1)(2)(3)(4)(5)(6)(7)(8)(9) \
|
||||
(10)(11)(12)(13)(14)(15)(16)(17)(18)(19) \
|
||||
(20)(21)(22)(23)(24)(25)(26)(27)(28)(29) \
|
||||
(30)(31)(32)(33)(34)(35)(36)(37)(38)(39) \
|
||||
(40)(41)(42)(43)(44)(45)(46)(47)(48)(49) \
|
||||
(50)(51)(52)(53)(54)(55)(56)(57)(58)(59) \
|
||||
(60)(61)(62)(63)(64)(65)(66)(67)(68)(69) \
|
||||
(70)(71)(72)(73)(74)(75)(76)(77)(78)(79) \
|
||||
(80)(81)(82)(83)(84)(85)(86)(87)(88)(89) \
|
||||
(90)(91)(92)(93)(94)(95)(96)(97)(98)(99) \
|
||||
(100)
|
||||
|
||||
(1)(2)(3)(4)(5)(6)(7)(8)(9) \
|
||||
(10)(11)(12)(13)(14)(15)(16)(17)(18)(19) \
|
||||
(20)(21)(22)(23)(24)(25)(26)(27)(28)(29) \
|
||||
(30)(31)(32)(33)(34)(35)(36)(37)(38)(39) \
|
||||
(40)(41)(42)(43)(44)(45)(46)(47)(48)(49) \
|
||||
(50)(51)(52)(53)(54)(55)(56)(57)(58)(59) \
|
||||
(60)(61)(62)(63)(64)(65)(66)(67)(68)(69) \
|
||||
(70)(71)(72)(73)(74)(75)(76)(77)(78)(79) \
|
||||
(80)(81)(82)(83)(84)(85)(86)(87)(88)(89) \
|
||||
(90)(91)(92)(93)(94)(95)(96)(97)(98)(99) \
|
||||
(100)
|
||||
|
||||
# define SEQ_255 \
|
||||
(1)(2)(3)(4)(5)(6)(7)(8)(9) \
|
||||
(10)(11)(12)(13)(14)(15)(16)(17)(18)(19) \
|
||||
(20)(21)(22)(23)(24)(25)(26)(27)(28)(29) \
|
||||
(30)(31)(32)(33)(34)(35)(36)(37)(38)(39) \
|
||||
(40)(41)(42)(43)(44)(45)(46)(47)(48)(49) \
|
||||
(50)(51)(52)(53)(54)(55)(56)(57)(58)(59) \
|
||||
(60)(61)(62)(63)(64)(65)(66)(67)(68)(69) \
|
||||
(70)(71)(72)(73)(74)(75)(76)(77)(78)(79) \
|
||||
(80)(81)(82)(83)(84)(85)(86)(87)(88)(89) \
|
||||
(90)(91)(92)(93)(94)(95)(96)(97)(98)(99) \
|
||||
(100)(101)(102)(103)(104)(105)(106)(107)(108)(109) \
|
||||
(110)(111)(112)(113)(114)(115)(116)(117)(118)(119) \
|
||||
(120)(121)(122)(123)(124)(125)(126)(127)(128)(129) \
|
||||
(130)(131)(132)(133)(134)(135)(136)(137)(138)(139) \
|
||||
(140)(141)(142)(143)(144)(145)(146)(147)(148)(149) \
|
||||
(150)(151)(152)(153)(154)(155)(156)(157)(158)(159) \
|
||||
(160)(161)(162)(163)(164)(165)(166)(167)(168)(169) \
|
||||
(170)(171)(172)(173)(174)(175)(176)(177)(178)(179) \
|
||||
(180)(181)(182)(183)(184)(185)(186)(187)(188)(189) \
|
||||
(190)(191)(192)(193)(194)(195)(196)(197)(198)(199) \
|
||||
(200)(201)(202)(203)(204)(205)(206)(207)(208)(209) \
|
||||
(210)(211)(212)(213)(214)(215)(216)(217)(218)(219) \
|
||||
(220)(221)(222)(223)(224)(225)(226)(227)(228)(229) \
|
||||
(230)(231)(232)(233)(234)(235)(236)(237)(238)(239) \
|
||||
(240)(241)(242)(243)(244)(245)(246)(247)(248)(249) \
|
||||
(250)(251)(252)(253)(254)(255)
|
||||
|
||||
(1)(2)(3)(4)(5)(6)(7)(8)(9) \
|
||||
(10)(11)(12)(13)(14)(15)(16)(17)(18)(19) \
|
||||
(20)(21)(22)(23)(24)(25)(26)(27)(28)(29) \
|
||||
(30)(31)(32)(33)(34)(35)(36)(37)(38)(39) \
|
||||
(40)(41)(42)(43)(44)(45)(46)(47)(48)(49) \
|
||||
(50)(51)(52)(53)(54)(55)(56)(57)(58)(59) \
|
||||
(60)(61)(62)(63)(64)(65)(66)(67)(68)(69) \
|
||||
(70)(71)(72)(73)(74)(75)(76)(77)(78)(79) \
|
||||
(80)(81)(82)(83)(84)(85)(86)(87)(88)(89) \
|
||||
(90)(91)(92)(93)(94)(95)(96)(97)(98)(99) \
|
||||
(100)(101)(102)(103)(104)(105)(106)(107)(108)(109) \
|
||||
(110)(111)(112)(113)(114)(115)(116)(117)(118)(119) \
|
||||
(120)(121)(122)(123)(124)(125)(126)(127)(128)(129) \
|
||||
(130)(131)(132)(133)(134)(135)(136)(137)(138)(139) \
|
||||
(140)(141)(142)(143)(144)(145)(146)(147)(148)(149) \
|
||||
(150)(151)(152)(153)(154)(155)(156)(157)(158)(159) \
|
||||
(160)(161)(162)(163)(164)(165)(166)(167)(168)(169) \
|
||||
(170)(171)(172)(173)(174)(175)(176)(177)(178)(179) \
|
||||
(180)(181)(182)(183)(184)(185)(186)(187)(188)(189) \
|
||||
(190)(191)(192)(193)(194)(195)(196)(197)(198)(199) \
|
||||
(200)(201)(202)(203)(204)(205)(206)(207)(208)(209) \
|
||||
(210)(211)(212)(213)(214)(215)(216)(217)(218)(219) \
|
||||
(220)(221)(222)(223)(224)(225)(226)(227)(228)(229) \
|
||||
(230)(231)(232)(233)(234)(235)(236)(237)(238)(239) \
|
||||
(240)(241)(242)(243)(244)(245)(246)(247)(248)(249) \
|
||||
(250)(251)(252)(253)(254)(255)
|
||||
|
||||
# define SEQ_256 SEQ_255(256)
|
||||
|
||||
# define SEQVAR (4,5,8,3,61)(1,0)(5,22,43)(2)(17,45,33)
|
||||
|
12
test/stringize.c
Normal file
12
test/stringize.c
Normal file
@ -0,0 +1,12 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/stringize.cxx>
|
12
test/stringize.cpp
Normal file
12
test/stringize.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/stringize.cxx>
|
38
test/stringize.cxx
Normal file
38
test/stringize.cxx
Normal file
@ -0,0 +1,38 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <boost/preprocessor/stringize.hpp>
|
||||
# include <boost/preprocessor/wstringize.hpp>
|
||||
# include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
# if !defined __cplusplus
|
||||
#include <wchar.h>
|
||||
#endif
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
|
||||
#define VDATA 1,2,3,4
|
||||
#define NDATA
|
||||
#define DATA data
|
||||
#define FDATA(x) BOOST_PP_INC(x)
|
||||
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
||||
BEGIN sizeof(BOOST_PP_STRINGIZE(NDATA)) / sizeof(char) == 1 END
|
||||
BEGIN sizeof(BOOST_PP_WSTRINGIZE(NDATA)) / sizeof(wchar_t) == 1 END
|
||||
#endif
|
||||
BEGIN sizeof(BOOST_PP_STRINGIZE(DATA)) / sizeof(char) == 5 END
|
||||
BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(1))) / sizeof(char) == 2 END
|
||||
BEGIN sizeof(BOOST_PP_STRINGIZE(FDATA(9))) / sizeof(char) == 3 END
|
||||
BEGIN sizeof(BOOST_PP_WSTRINGIZE(DATA)) / sizeof(wchar_t) == 5 END
|
||||
BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(1))) / sizeof(wchar_t) == 2 END
|
||||
BEGIN sizeof(BOOST_PP_WSTRINGIZE(FDATA(9))) / sizeof(wchar_t) == 3 END
|
||||
#if BOOST_PP_VARIADICS
|
||||
BEGIN sizeof(BOOST_PP_STRINGIZE(VDATA)) / sizeof(char) == 8 END
|
||||
BEGIN sizeof(BOOST_PP_WSTRINGIZE(VDATA)) / sizeof(wchar_t) == 8 END
|
||||
#endif
|
21
test/test.h
21
test/test.h
@ -14,24 +14,7 @@
|
||||
# ifndef BOOST_LIBS_PREPROCESSOR_REGRESSION_TEST_H
|
||||
# define BOOST_LIBS_PREPROCESSOR_REGRESSION_TEST_H
|
||||
#
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <libs/preprocessor/test/test_macro.h>
|
||||
# include <libs/preprocessor/test/test_main.h>
|
||||
#
|
||||
# define BEGIN typedef int BOOST_PP_CAT(test_, __LINE__)[((
|
||||
# define END )==1) ? 1 : -1];
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#include <cstdio>
|
||||
#if !defined(_STLP_MSVC) || _STLP_MSVC >= 1300
|
||||
namespace std { }
|
||||
using namespace std;
|
||||
#endif
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
printf("pass " __TIME__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
# endif
|
||||
|
22
test/test_macro.h
Normal file
22
test/test_macro.h
Normal file
@ -0,0 +1,22 @@
|
||||
# /* Copyright (C) 2001
|
||||
# * Housemarque Oy
|
||||
# * http://www.housemarque.com
|
||||
# *
|
||||
# * 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)
|
||||
# */
|
||||
#
|
||||
# /* Revised by Paul Mensonides (2002) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_LIBS_PREPROCESSOR_REGRESSION_TEST_MACRO_H
|
||||
# define BOOST_LIBS_PREPROCESSOR_REGRESSION_TEST_MACRO_H
|
||||
#
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
#
|
||||
# define BEGIN typedef int BOOST_PP_CAT(test_, __LINE__)[((
|
||||
# define END )==1) ? 1 : -1];
|
||||
#
|
||||
# endif
|
32
test/test_main.h
Normal file
32
test/test_main.h
Normal file
@ -0,0 +1,32 @@
|
||||
# /* Copyright (C) 2001
|
||||
# * Housemarque Oy
|
||||
# * http://www.housemarque.com
|
||||
# *
|
||||
# * 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)
|
||||
# */
|
||||
#
|
||||
# /* Revised by Paul Mensonides (2002) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# ifndef BOOST_LIBS_PREPROCESSOR_REGRESSION_TEST_MAIN_H
|
||||
# define BOOST_LIBS_PREPROCESSOR_REGRESSION_TEST_MAIN_H
|
||||
#
|
||||
#if defined(__cplusplus)
|
||||
#include <cstdio>
|
||||
#if !defined(_STLP_MSVC) || _STLP_MSVC >= 1300
|
||||
namespace std { }
|
||||
using namespace std;
|
||||
#endif
|
||||
#else
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
printf("pass " __TIME__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
# endif
|
@ -17,21 +17,21 @@
|
||||
#define TN_GEN_ONE(p) (1)
|
||||
#define TN_GEN_ZERO(p) (0)
|
||||
#define TN_TEST_ONE_MORE(parameter,ens) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(1,0,ens),0), \
|
||||
TN_GEN_ONE, \
|
||||
TN_GEN_ZERO \
|
||||
) \
|
||||
(parameter) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(1,0,ens),0), \
|
||||
TN_GEN_ONE, \
|
||||
TN_GEN_ZERO \
|
||||
) \
|
||||
(parameter) \
|
||||
/**/
|
||||
#define TN_TEST_ONE(parameter,ens) \
|
||||
BOOST_PP_TUPLE_ELEM \
|
||||
( \
|
||||
1, \
|
||||
0, \
|
||||
TN_TEST_ONE_MORE(parameter,ens) \
|
||||
) \
|
||||
BOOST_PP_TUPLE_ELEM \
|
||||
( \
|
||||
1, \
|
||||
0, \
|
||||
TN_TEST_ONE_MORE(parameter,ens) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
BEGIN TN_TEST_ONE(A,(1)) == 1 END
|
||||
|
12
test/vaopt.cpp
Normal file
12
test/vaopt.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/vaopt.cxx>
|
88
test/vaopt.cxx
Normal file
88
test/vaopt.cxx
Normal file
@ -0,0 +1,88 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
# include <boost/preprocessor/variadic/has_opt.hpp>
|
||||
|
||||
# if BOOST_PP_VARIADIC_HAS_OPT()
|
||||
|
||||
# include <boost/preprocessor/facilities/empty.hpp>
|
||||
# include <boost/preprocessor/facilities/va_opt.hpp>
|
||||
# include <boost/preprocessor/variadic/elem.hpp>
|
||||
|
||||
#define DATA
|
||||
#define OBJECT OBJECT2
|
||||
#define OBJECT2
|
||||
#define FUNC(x) FUNC2(x)
|
||||
#define FUNC2(x)
|
||||
#define FUNC_GEN() ()
|
||||
#define FUNC_GEN2(x) ()
|
||||
#define FUNC_GEN3() (&)
|
||||
#define FUNC_GEN4(x) (y)
|
||||
#define FUNC_GEN5() (y,z)
|
||||
#define FUNC_GEN6() anything
|
||||
#define FUNC_GEN7(x) anything
|
||||
#define FUNC_GEN8(x,y) (1,2,3)
|
||||
#define FUNC_GEN9(x,y,z) anything
|
||||
#define FUNC_GEN10(x) (y) data
|
||||
#define NAME &name
|
||||
#define ATUPLE (atuple)
|
||||
#define ATUPLE_PLUS (atuple) data
|
||||
|
||||
#define TRY_PASS_EMPTY_STD(...) BOOST_PP_VARIADIC_ELEM(0, __VA_OPT__ (0,) 1)
|
||||
#define TRY_PASS_EMPTY_BOOST(...) BOOST_PP_VARIADIC_ELEM(0,BOOST_PP_VA_OPT((0),(1),__VA_ARGS__))
|
||||
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC_GEN) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC_GEN) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC_GEN2) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC_GEN2) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC_GEN3) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC_GEN3) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC_GEN4) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC_GEN4) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC_GEN5) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC_GEN5) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC_GEN8) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC_GEN8) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC_GEN9) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC_GEN9) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC_GEN10) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC_GEN10) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(DATA BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(DATA BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_STD() == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST() == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(DATA) == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(DATA) == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(x BOOST_PP_EMPTY()) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(x BOOST_PP_EMPTY()) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(OBJECT BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(OBJECT BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC(z) BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC(z) BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC_GEN6) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC_GEN6) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(FUNC_GEN7) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(FUNC_GEN7) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(NAME) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(NAME) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(ATUPLE) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(ATUPLE) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_STD(ATUPLE_PLUS) == 0 END
|
||||
BEGIN TRY_PASS_EMPTY_BOOST(ATUPLE_PLUS) == 0 END
|
||||
|
||||
# else
|
||||
|
||||
BEGIN 1 == 1 END
|
||||
|
||||
# endif
|
Reference in New Issue
Block a user