mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-06-30 06:20:57 +02:00
Compare commits
69 Commits
boost-1.57
...
mclow-patc
Author | SHA1 | Date | |
---|---|---|---|
1be8ba2320 | |||
34af3a925c | |||
ad22f9686e | |||
aa9ee3ae3f | |||
f54e270433 | |||
08ec2abb2e | |||
c4b1ce10bd | |||
1ecc2e2ec9 | |||
dfc1c46ece | |||
e474eea44f | |||
b03c6cd3c0 | |||
d8389ffda6 | |||
dc41624aba | |||
4ae346bbc5 | |||
d922d757be | |||
eb143c10f8 | |||
e1e3a2e21e | |||
e70abe7b49 | |||
ee73989a21 | |||
7835ed019c | |||
3292532517 | |||
4e29a160b9 | |||
b1be22cf77 | |||
f59d83b8bf | |||
88c4282493 | |||
02ab183b96 | |||
735e301c46 | |||
e983c16e61 | |||
132eb67cec | |||
4c39e92496 | |||
2689b91d91 | |||
478bb6e10e | |||
3c3c7b42d9 | |||
3f97464c27 | |||
d4fbb8fda2 | |||
38e7f69054 | |||
3ed3cd689e | |||
fc6229660e | |||
b125850bbb | |||
350c0e59b1 | |||
2612bf706c | |||
b84235fcb7 | |||
4aa8ae8a01 | |||
9044b17f18 | |||
106f5a43a1 | |||
915ab7834c | |||
dc61cc1373 | |||
4c2c83f9f2 | |||
862f64c45c | |||
06c18a67f8 | |||
eb2a675b8f | |||
b12333b419 | |||
1543b5fbf7 | |||
86378d648e | |||
633f1e679a | |||
4360660e39 | |||
827ff0905c | |||
9cb039ab8b | |||
1b3fe1570b | |||
4f0adfb553 | |||
01848af60d | |||
dc54fee21c | |||
77a9177c31 | |||
f1165249fb | |||
fd135a078f | |||
eedd7378f1 | |||
e1ade3ea3b | |||
3760758d4e | |||
0baf10bfc6 |
39
.travis.yml
Normal file
39
.travis.yml
Normal file
@ -0,0 +1,39 @@
|
||||
# Copyright 2016 Edward Diener
|
||||
# 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
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
- git clone -b $TRAVIS_BRANCH --depth 1 https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init tools/boostdep
|
||||
- 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
|
||||
|
||||
notifications:
|
||||
email:
|
||||
on_success: always
|
36
appveyor.yml
Normal file
36
appveyor.yml
Normal file
@ -0,0 +1,36 @@
|
||||
# Copyright 2017 Edward Diener
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
|
||||
version: 1.0.{build}-{branch}
|
||||
|
||||
shallow_clone: true
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- develop
|
||||
|
||||
environment:
|
||||
matrix:
|
||||
- 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
|
||||
|
||||
install:
|
||||
- cd ..
|
||||
- git clone -b %APPVEYOR_REPO_BRANCH% https://github.com/boostorg/boost.git boost-root
|
||||
- cd boost-root
|
||||
- git submodule update --init tools/build
|
||||
- git submodule update --init libs/config
|
||||
- git submodule update --init tools/boostdep
|
||||
- xcopy /s /e /q %APPVEYOR_BUILD_FOLDER% libs\preprocessor
|
||||
- python tools/boostdep/depinst/depinst.py preprocessor
|
||||
- bootstrap
|
||||
- b2 headers
|
||||
|
||||
build: off
|
||||
|
||||
test_script:
|
||||
- b2 libs/preprocessor/test toolset=%TOOLSET%
|
2494
doc/AppendixA-AnIntroductiontoPreprocessorMetaprogramming.html
Normal file
2494
doc/AppendixA-AnIntroductiontoPreprocessorMetaprogramming.html
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,29 +1,38 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>contents.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
<style>
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
|
||||
<title>contents.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
<style>
|
||||
a, a:link, a:visited { color: black; font-weight: bold; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h4><a href="http://www.boostpro.com/mplbook/preprocessor.html" target="_top">Introduction</a></h4>
|
||||
<h4><a href="topics.html">Topics</h4>
|
||||
<h4><a href="terms.html">Terminology</h4>
|
||||
<h4><a href="data.html">Data Types</h4>
|
||||
<h4><a href="ref.html">Reference</h4>
|
||||
<h4><a href="headers.html">Headers</h4>
|
||||
<h4><a href="examples.html">Examples</h4>
|
||||
<h4><a href="miscellanea.html">Miscellanea</h4>
|
||||
|
||||
<!--
|
||||
<EFBFBD> Copyright Housemarque Oy 2002
|
||||
<EFBFBD> Copyright Paul Mensonides 2002
|
||||
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)
|
||||
-->
|
||||
|
||||
</body>
|
||||
</html>
|
||||
</head>
|
||||
<body>
|
||||
<h4><a href="AppendixA-AnIntroductiontoPreprocessorMetaprogramming.html"
|
||||
target="_top">Introduction</a></h4>
|
||||
<h4><a href="topics.html">Topics</a></h4>
|
||||
<a href="topics.html">
|
||||
</a>
|
||||
<h4><a href="topics.html"></a><a href="terms.html">Terminology</a></h4>
|
||||
<a href="terms.html">
|
||||
</a>
|
||||
<h4><a href="terms.html"></a><a href="data.html">Data Types</a></h4>
|
||||
<a href="data.html">
|
||||
</a>
|
||||
<h4><a href="data.html"></a><a href="ref.html">Reference</a></h4>
|
||||
<a href="ref.html">
|
||||
</a>
|
||||
<h4><a href="ref.html"></a><a href="headers.html">Headers</a></h4>
|
||||
<a href="headers.html">
|
||||
</a>
|
||||
<h4><a href="headers.html"></a><a href="examples.html">Examples</a></h4>
|
||||
<a href="examples.html">
|
||||
</a>
|
||||
<h4><a href="examples.html"></a><a href="miscellanea.html">Miscellanea</a></h4>
|
||||
<a href="miscellanea.html">
|
||||
<!--
|
||||
<EFBFBD> Copyright Housemarque Oy 2002<30> Copyright Paul Mensonides 2002
|
||||
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)--> </a>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
|
||||
<title>arrays.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
@ -17,12 +18,19 @@
|
||||
size. It only requires that an element exists at a certain index. </div>
|
||||
<div> This allows macro parameters to be variable in size and allows data
|
||||
states to change size without the user explicitly keeping track of the
|
||||
size independently.</div>
|
||||
size independently.<br>
|
||||
<br>
|
||||
An <i>array </i>can be empty and have no elements. An empty array has a
|
||||
0 size. The notation for an empty array is '(0,())'.<br>
|
||||
<br>
|
||||
<span style="font-style: italic;"> </span></div>
|
||||
<div>With variadic macro support a <i>tuple </i>has all of the
|
||||
functionality as an <i>array</i>, knows its own size, and is easier
|
||||
syntactically to use. Because of that an <i>array</i> should be used, as
|
||||
opposed to a <i>tuple</i>, only if your compiler does not support
|
||||
variadic macros.<br>
|
||||
variadic macros. The only advantage an <i>array </i>has over a <i>tuple
|
||||
</i>is that an <i>array </i>can be empty while a <i>tuple </i>always
|
||||
has at least one element and therefore can never have a size of 0.<br>
|
||||
<br>
|
||||
Elements of an <i>array</i> can be extracted with <b>BOOST_PP_ARRAY_ELEM</b>,
|
||||
an <i>array's</i> size can be extracted with <b>BOOST_PP_ARRAY_SIZE</b>,
|
||||
|
@ -1,46 +1,42 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>lists.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<h4>Lists</h4>
|
||||
<div>
|
||||
A <i>list</i> is a simple cons-style list with a head and a tail.
|
||||
The head of a <i>list</i> is an element,
|
||||
and the tail is either another <i>list</i> or <b>BOOST_PP_NIL</b>.
|
||||
For example,
|
||||
</div>
|
||||
<div class="code">
|
||||
(<i>a</i>, (<i>b</i>, (<i>c</i>, <b>BOOST_PP_NIL</b>)))
|
||||
</div>
|
||||
<div>
|
||||
...is a <i>list</i> of <i>3</i> elements--<i>a</i>, <i>b</i>, and <i>c</i>.
|
||||
</div>
|
||||
<div>
|
||||
This allows macro parameters to be variable in size and allows data states to change
|
||||
size without the user explicitly keeping track of the size independently.
|
||||
</div>
|
||||
<div>
|
||||
Elements of a <i>list</i> can be extracted with
|
||||
<b>BOOST_PP_LIST_FIRST</b> and <b>BOOST_PP_LIST_REST</b>.
|
||||
</div>
|
||||
<h4>Primitives</h4>
|
||||
<ul>
|
||||
<li><a href="../ref/list_first.html">BOOST_PP_LIST_FIRST</a></li>
|
||||
<li><a href="../ref/list_rest.html">BOOST_PP_LIST_REST</a></li>
|
||||
<li><a href="../ref/nil.html">BOOST_PP_NIL</a></li>
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;">
|
||||
<i><EFBFBD> Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
|
||||
</br><i><EFBFBD> Copyright Paul Mensonides 2002</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>
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
|
||||
<title>lists.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<h4>Lists</h4>
|
||||
<div> A <i>list</i> is a simple cons-style list with a head and a
|
||||
tail. The head of a <i>list</i> is an element, and the tail is
|
||||
either another <i>list</i> or <b>BOOST_PP_NIL</b>. For example, </div>
|
||||
<div class="code"> (<i>a</i>, (<i>b</i>, (<i>c</i>, <b>BOOST_PP_NIL</b>)))
|
||||
</div>
|
||||
<div> ...is a <i>list</i> of <i>3</i> elements--<i>a</i>, <i>b</i>, and <i>c</i>.
|
||||
</div>
|
||||
<div> This allows macro parameters to be variable in size and allows data
|
||||
states to change size without the user explicitly keeping track of the
|
||||
size independently.<br>
|
||||
<br>
|
||||
A list can be empty and therefore have a size of 0. An empty list is
|
||||
represented by the notation <b>BOOST_PP_NIL.<br>
|
||||
<br>
|
||||
</b></div>
|
||||
<div> Elements of a <i>list</i> can be extracted with <b>BOOST_PP_LIST_FIRST</b>
|
||||
and <b>BOOST_PP_LIST_REST</b>. </div>
|
||||
<h4>Primitives</h4>
|
||||
<ul>
|
||||
<li><a href="../ref/list_first.html">BOOST_PP_LIST_FIRST</a></li>
|
||||
<li><a href="../ref/list_rest.html">BOOST_PP_LIST_REST</a></li>
|
||||
<li><a href="../ref/nil.html">BOOST_PP_NIL</a></li>
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i><EFBFBD> Copyright <a href="http://www.housemarque.com"
|
||||
target="_top">Housemarque Oy</a> 2002</i> <br>
|
||||
<i><EFBFBD> Copyright Paul Mensonides 2002</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>
|
||||
|
@ -1,30 +1,23 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>sequences.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<h4>
|
||||
Sequences
|
||||
</h4>
|
||||
<div>
|
||||
A <i>sequence</i> (abbreviated to <i>seq</i>) is a group of adjacent parenthesized elements. For example,
|
||||
</div>
|
||||
<div class="code">
|
||||
(<i>a</i>)(<i>b</i>)(<i>c</i>)
|
||||
</div>
|
||||
<div>
|
||||
...is a <i>seq</i> of <i>3</i> elements--<i>a</i>, <i>b</i>, and <i>c</i>.
|
||||
</div>
|
||||
<div>
|
||||
<i>Sequences</i> are data structures that merge the properties of both <i>lists</i> and
|
||||
<i>tuples</i> with the exception that a <i>seq</i> cannot be empty.
|
||||
Therefore, an "empty" <i>seq</i> is considered a special case scenario that
|
||||
must be handled separately in C++.
|
||||
</div>
|
||||
<div class="code">
|
||||
<pre>
|
||||
#define SEQ (x)(y)(z)
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
|
||||
<title>sequences.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<h4> Sequences </h4>
|
||||
<div> A <i>sequence</i> (abbreviated to <i>seq</i>) is a group of adjacent
|
||||
parenthesized elements. For example, </div>
|
||||
<div class="code"> (<i>a</i>)(<i>b</i>)(<i>c</i>) </div>
|
||||
<div> ...is a <i>seq</i> of <i>3</i> elements--<i>a</i>, <i>b</i>, and <i>c</i>.
|
||||
</div>
|
||||
<div> <i>Sequences</i> are data structures that merge the properties of
|
||||
both <i>lists</i> and <i>tuples</i> with the exception that a <i>seq, </i>like
|
||||
a <i>tuple, </i>cannot be empty. Therefore, an "empty" <i>seq</i>
|
||||
is considered a special case scenario that must be handled separately in
|
||||
C++. </div>
|
||||
<div class="code">
|
||||
<pre>#define SEQ (x)(y)(z)
|
||||
#define REVERSE(s, state, elem) (elem) state
|
||||
// append to head ^
|
||||
|
||||
@ -41,35 +34,27 @@ BOOST_PP_SEQ_FOLD_RIGHT(INC, BOOST_PP_SEQ_NIL, SEQ)
|
||||
// ^
|
||||
// special placeholder that will be "eaten"
|
||||
// by appending to the tail
|
||||
</pre>
|
||||
</div>
|
||||
<div>
|
||||
<i>Sequences</i> are extremely efficient. Element access speed approaches
|
||||
random access--even with <i>seqs</i> of up to <i>256</i> elements. This
|
||||
is because element access (among other things) is implemented iteratively
|
||||
rather than recursively. Therefore, elements can be accessed at extremely
|
||||
high indices even on preprocessors with low maximum expansion depths.
|
||||
</div>
|
||||
<div>
|
||||
Elements of a <i>seq</i> can be extracted with <b>BOOST_PP_SEQ_ELEM</b>.
|
||||
</div>
|
||||
<h4>
|
||||
Primitives
|
||||
</h4>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="../ref/seq_elem.html">BOOST_PP_SEQ_ELEM</a></li>
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;">
|
||||
<i><EFBFBD> Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
|
||||
</br><i><EFBFBD> Copyright Paul Mensonides 2002</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>
|
||||
</pre> </div>
|
||||
<div> <i>Sequences</i> are extremely efficient. Element access speed
|
||||
approaches random access--even with <i>seqs</i> of up to <i>256</i>
|
||||
elements. This is because element access (among other things) is
|
||||
implemented iteratively rather than recursively. Therefore, elements
|
||||
can be accessed at extremely high indices even on preprocessors with low
|
||||
maximum expansion depths. </div>
|
||||
<div> Elements of a <i>seq</i> can be extracted with <b>BOOST_PP_SEQ_ELEM</b>.
|
||||
</div>
|
||||
<h4> Primitives </h4>
|
||||
<ul>
|
||||
<li> <a href="../ref/seq_elem.html">BOOST_PP_SEQ_ELEM</a></li>
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i><EFBFBD> Copyright <a href="http://www.housemarque.com"
|
||||
target="_top">Housemarque Oy</a> 2002</i> <br>
|
||||
<i><EFBFBD> Copyright Paul Mensonides 2002</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>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
|
||||
<title>tuples.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
@ -9,13 +10,19 @@
|
||||
parenthesis. For example, </div>
|
||||
<div class="code"> (<i>a</i>, <i>b</i>, <i>c</i>) </div>
|
||||
<div> ...is a <i>tuple</i> of <i>3</i> elements--<i>a</i>, <i>b</i>, and
|
||||
<i>c</i>. </div>
|
||||
<i>c</i>.<br>
|
||||
<br>
|
||||
A <i>tuple </i>cannot be empty. The notation '()' as a <i>tuple </i>is
|
||||
a single element <i>tuple </i>of size 1, where the element is empty. </div>
|
||||
<div> <i>Tuples</i> are fast and easy to use. With variadic macro
|
||||
support it is not necessary to know the size of a <i>tuple; </i>without
|
||||
variadic macro support all access to <i>tuples</i> requires
|
||||
knowledge of its size. Use a <i>tuple </i>instead of an <i>array</i> if
|
||||
your compiler supports variadic macros, since a <i>tuple </i>has all of
|
||||
the functionality as an <i>array </i>and is easier syntactically to use.</div>
|
||||
the functionality as an <i>array </i>and is easier syntactically to use.
|
||||
The only functionality an <i>array </i>has which a <i>tuple </i>does
|
||||
not have is that an <i>array </i>can be empty whereas a <i>tuple </i>cannot
|
||||
be empty.</div>
|
||||
<div> Elements of a <i>tuple</i> can be extracted with <b>BOOST_PP_TUPLE_ELEM</b>.
|
||||
</div>
|
||||
<h4>Primitives</h4>
|
||||
|
@ -54,7 +54,7 @@
|
||||
<li class="ps"><a href="headers/comparison/not_equal.html">not_equal.hpp</a></li>
|
||||
<li>config/</li>
|
||||
<li class="ps"><a href="headers/config/limits.html">limits.hpp</a></li>
|
||||
<li class="ps"><a href="headers/config/variadics.html">variadics.hpp</a></li>
|
||||
<li class="ps"><a href="headers/config/variadics.html">config.hpp</a></li>
|
||||
<li><a href="headers/control.html">control.hpp</a></li>
|
||||
<li>control/</li>
|
||||
<li class="ps"><a href="headers/control/deduce_d.html">deduce_d.hpp</a></li>
|
||||
|
@ -1,19 +1,19 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>config/variadics.hpp</title>
|
||||
<title>config/config.hpp</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>config/variadics.hpp</b>
|
||||
header defines a macro for determining variadic macro support. The file
|
||||
is automatically included when needed internally. The end-user can
|
||||
include it also in order to use the macro. </div>
|
||||
The <b>config/config.hpp</b>
|
||||
header defines internal configuration macros as well as a macro for determining variadic macro support. The file
|
||||
is automatically included whenever any Boost PP macros are used. The end-user can manually
|
||||
include it in order to use the BOOST_PP_VARIADICS macro, but normally should never have to do so. </div>
|
||||
<h4>
|
||||
Usage
|
||||
</h4>
|
||||
<div class="code">
|
||||
#include <b><boost/preprocessor/config/variadics.hpp></b>
|
||||
#include <b><boost/preprocessor/config/config.hpp></b>
|
||||
</div>
|
||||
<h4>
|
||||
Contents
|
||||
@ -21,7 +21,7 @@ include it also in order to use the macro. </div>
|
||||
<ul>
|
||||
<li><a href="../../ref/variadics.html">BOOST_PP_VARIADICS</a></li></ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"><i><EFBFBD> Copyright Edward Diener 2011</i>
|
||||
<div style="margin-left: 0px;"><i><EFBFBD> Copyright Edward Diener 2011,2014</i>
|
||||
</div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
@ -5,7 +5,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>facilities/identity.hpp</b> header defines a utility macro to use with <b>BOOST_PP_IF</b> and <b>BOOST_PP_IIF</b>.
|
||||
The <b>facilities/identity.hpp</b> header defines utility macros to use with <b>BOOST_PP_IF</b> and <b>BOOST_PP_IIF</b>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
@ -14,11 +14,13 @@
|
||||
<h4>Contents</h4>
|
||||
<ul>
|
||||
<li><a href="../../ref/identity.html">BOOST_PP_IDENTITY</a></li>
|
||||
<li><a href="../../ref/identity_n.html">BOOST_PP_IDENTITY_N</a></li>
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;">
|
||||
<i><EFBFBD> Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
|
||||
</br><i><EFBFBD> Copyright Paul Mensonides 2002</i>
|
||||
</br><i><EFBFBD> Copyright Edward Diener 2015</i>
|
||||
</div>
|
||||
<div style="margin-left: 0px;">
|
||||
<p><small>Distributed under the Boost Software License, Version 1.0. (See
|
||||
|
@ -2,7 +2,7 @@
|
||||
<title>tuple/enum.hpp</title>
|
||||
<link rel="stylesheet" type="text/css" href="../../styles.css"></head><body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>tuple/enum.hpp</b> header defines a macro to onvert a <i>tuple</i> to its comma-separated elements.
|
||||
The <b>tuple/enum.hpp</b> header defines a macro to convert a <i>tuple</i> to its comma-separated elements.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
|
@ -99,6 +99,7 @@
|
||||
<li><a href="ref/greater_equal_d.html">GREATER_EQUAL_D</a></li>
|
||||
<!-- I -->
|
||||
<li><a href="ref/identity.html">IDENTITY</a></li>
|
||||
<li><a href="ref/identity_n.html">IDENTITY_N</a></li>
|
||||
<li><a href="ref/if.html">IF</a></li>
|
||||
<li><a href="ref/iif.html">IIF</a></li>
|
||||
<li><a href="ref/inc.html">INC</a></li>
|
||||
|
@ -34,7 +34,7 @@
|
||||
It is more efficient, however, to use <b>BOOST_PP_ADD_D</b> in such a situation.
|
||||
</div>
|
||||
<div>
|
||||
This macro is the most efficient when <i>x</i> is less than or equal to <i>y</i>.
|
||||
This macro is the most efficient when <i>x</i> is greater than or equal to <i>y</i>.
|
||||
However, the efficiency gain is not worth actually comparing the two arguments prior to invocation.
|
||||
In other words, <i>x</i> should be the addend that is <i>most likely</i> to be the largest of the two operands.
|
||||
</div>
|
||||
|
@ -34,7 +34,7 @@
|
||||
If the sum of <i>x</i> and <i>y</i> is greater than <b>BOOST_PP_LIMIT_MAG</b>, the result is saturated to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</div>
|
||||
<div>
|
||||
This macro is the most efficient when <i>x</i> is less than or equal to <i>y</i>.
|
||||
This macro is the most efficient when <i>x</i> is greater than or equal to <i>y</i>.
|
||||
However, the efficiency gain is not worth actually comparing the two arguments prior to invocation.
|
||||
In other words, <i>x</i> should be the addend that is <i>most likely</i> to be the largest of the two operands.
|
||||
</div>
|
||||
|
58
doc/ref/identity_n.html
Normal file
58
doc/ref/identity_n.html
Normal file
@ -0,0 +1,58 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_IDENTITY_N</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_IDENTITY_N</b> macro expands to its first argument when invoked.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_IDENTITY_N</b>(<i>item,n</i>)(n-arguments)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>item</dt>
|
||||
<dd>
|
||||
The result of the expansion.
|
||||
</dd>
|
||||
<dt>n</dt>
|
||||
<dd>
|
||||
The number of arguments when invoked.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is designed to be used with <b>BOOST_PP_IF</b> and <b>BOOST_PP_IIF</b> when only one of the clauses needs to be invoked.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="if.html">BOOST_PP_IF</a></li>
|
||||
<li><a href="iif.html">BOOST_PP_IIF</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/facilities/identity.html"><boost/preprocessor/facilities/identity.hpp></a>
|
||||
</div>
|
||||
<h4>Sample Code</h4>
|
||||
<div><pre>
|
||||
#include <<a href="../headers/control/if.html">boost/preprocessor/control/if.hpp</a>>
|
||||
#include <<a href="../headers/facilities/identity.html">boost/preprocessor/facilities/identity.hpp</a>>
|
||||
|
||||
#define MACRO_CAT(y,z) y ## z
|
||||
#define MACRO(n) <a href="if.html">BOOST_PP_IF</a>(n, <a href="identity_n.html">BOOST_PP_IDENTITY_N</a>(x,2), MACRO_CAT)(a,b)
|
||||
|
||||
MACRO(0) // expands to ab
|
||||
MACRO(1) // expands to x
|
||||
</pre></div>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px"><i>© Copyright Edward Diener 2015</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>
|
@ -1,34 +1,39 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_REPEAT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_REPEAT</b> macro defines the maximum number of repetitions supported by each <b>BOOST_PP_REPEAT</b> dimension.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_REPEAT</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro current expands to <i>256</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</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>
|
||||
</br><i><EFBFBD> Copyright Paul Mensonides 2002</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>
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
|
||||
<title>BOOST_PP_LIMIT_REPEAT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;"> The <b>BOOST_PP_LIMIT_REPEAT</b> macro
|
||||
defines the maximum number of repetitions supported by each <b>BOOST_PP_REPEAT</b>
|
||||
dimension. </div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code"> <b>BOOST_PP_LIMIT_REPEAT</b> </div>
|
||||
<h4>Remarks</h4>
|
||||
<div> This macro current expands to <i>256</i>.<br>
|
||||
<br>
|
||||
NOTE: for the current latest versions of Microsoft's VC++ compiler there
|
||||
is a nested macro limit of 256. This means in actuality that the number of
|
||||
repetitions using VC++ is actually less than 256 depending on the
|
||||
repetition macro being used. For the BOOST_PP_REPEAT macro this limit
|
||||
appears to be 252 while for the BOOST_PP_ENUM... series of macros this
|
||||
limit appears to be around 230, before the VC++ compiler gives a "C1009:
|
||||
compiler limit : macros nested too deeply" error. This is a compiler
|
||||
limitation of VC++ which may vary depending on the specific repetition
|
||||
macro being used, and therefore is not a problem the preprocessor library
|
||||
can solve.</div>
|
||||
<h4>Requirements</h4>
|
||||
<div> <b>Header:</b> <a href="../headers/config/limits.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</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> <br>
|
||||
<i><EFBFBD> Copyright Paul Mensonides 2002</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>
|
||||
|
@ -34,7 +34,7 @@
|
||||
It is more efficient, however, to use <b>BOOST_PP_MUL_D</b> in such a situation.
|
||||
</div>
|
||||
<div>
|
||||
This macro is the most efficient when <i>x</i> is less than or equal to <i>y</i>.
|
||||
This macro is the most efficient when <i>x</i> is greater than or equal to <i>y</i>.
|
||||
However, the efficiency gain is not worth actually comparing the two arguments prior to invocation.
|
||||
In other words, <i>x</i> should be the value that is <i>most likely</i> to be the largest of the two operands.
|
||||
</div>
|
||||
|
@ -34,7 +34,7 @@
|
||||
If the product of <i>x</i> and <i>y</i> is greater than <b>BOOST_PP_LIMIT_MAG</b>, the result is saturated to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</div>
|
||||
<div>
|
||||
This macro is the most efficient when <i>x</i> is less than or equal to <i>y</i>.
|
||||
This macro is the most efficient when <i>x</i> is greater than or equal to <i>y</i>.
|
||||
However, the efficiency gain is not worth actually comparing the two arguments prior to invocation.
|
||||
In other words, <i>x</i> should be the value that is <i>most likely</i> to be the largest of the two operands.
|
||||
</div>
|
||||
|
@ -1,46 +1,58 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
|
||||
<title>BOOST_PP_OVERLOAD</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;"> The <b>BOOST_PP_OVERLOAD</b> variadic macro expands to the name of a non-variadic macro having a given number of parameters.<br>
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code"> <b>BOOST_PP_OVERLOAD</b>(<i>prefix</i>,...) <a href="../topics/variadic_macros.html#VNotation" target="_self"><sup>(v)</sup></a><br>
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>prefix<br>
|
||||
</dt><dd>
|
||||
The prefix of the non-variadic macro name.
|
||||
</dd><dt>...<br>
|
||||
</dt><dd><i>
|
||||
Variadic data</i>. The number of variadic data
|
||||
elements, as determined by BOOST_PP_VARIADIC_SIZE, is appended to the
|
||||
prefix to form the output non-variadic macro name.<br>
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div> This macro creates a macro name which depends on the number of elements of variadic data. It should be used in the form of <br>
|
||||
BOOST_PP_OVERLOAD(MACRO_NAME_,__VA_ARGS__)(__VA_ARGS__) in order to
|
||||
call a non-variadic macro taking a given number of variadic data
|
||||
elements as non-variadic arguments. In this way one can invoke a
|
||||
variadic macro with a variable number of parameters which calls one of
|
||||
a series of non-variadic macros doing very similar things.
|
||||
</div><b>Requirements</b>
|
||||
<div> <b>Header:</b> <a href="../headers/facilities/overload.html"><boost/preprocessor/facilities/overload.hpp></a>
|
||||
<div style="margin-left: 0px;"> The <b>BOOST_PP_OVERLOAD</b> variadic
|
||||
macro expands to the name of a non-variadic macro having a given number of
|
||||
parameters.<br>
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code"> <b>BOOST_PP_OVERLOAD</b>(<i>prefix</i>,...) <a href="../topics/variadic_macros.html#VNotation"
|
||||
target="_self"><sup>(v)</sup></a><br>
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>prefix<br>
|
||||
</dt>
|
||||
<dd> The prefix of the non-variadic macro name. </dd>
|
||||
<dt>...<br>
|
||||
</dt>
|
||||
<dd><i> Variadic data</i>. The number of variadic data
|
||||
elements, as determined by BOOST_PP_VARIADIC_SIZE, is appended to the
|
||||
prefix to form the output non-variadic macro name.<br>
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div> This macro creates a macro name which depends on the number of
|
||||
elements of variadic data. It should be used in the form of <br>
|
||||
BOOST_PP_OVERLOAD(MACRO_NAME_,__VA_ARGS__)(__VA_ARGS__) in order to
|
||||
call a non-variadic macro taking a given number of variadic data
|
||||
elements as non-variadic arguments. In this way one can invoke a
|
||||
variadic macro with a variable number of parameters which calls one of
|
||||
a series of non-variadic macros doing very similar things.
|
||||
</div>
|
||||
<b>Requirements</b>
|
||||
<div> <b>Header:</b> <a href="../headers/facilities/overload.html"><boost/preprocessor/facilities/overload.hpp></a>
|
||||
</div>
|
||||
<h4>Sample Code</h4>
|
||||
<div>
|
||||
<pre>#include <<a href="../headers/facilities/overload.html">boost/preprocessor/facilities/overload.hpp</a>><br>#include <<a
|
||||
href="../headers/cat.html">boost/preprocessor/cat.hpp</a>><br>#include <<a href="../headers/facilities/empty.html">boost/preprocessor/facilities/empty.hpp</a>><br>#include <<a
|
||||
href="../headers/arithmetic/add.html">boost/preprocessor/arithmetic/add.hpp</a>><br><br>#define MACRO_1(number) MACRO_2(number,10)<br>#define MACRO_2(number1,number2) <a
|
||||
href="add.html">BOOST_PP_ADD</a>(number1,number2)<br><br>#if !BOOST_PP_VARIADICS_MSVC<br><br>#define MACRO_ADD_NUMBERS(...) <a
|
||||
href="overload.html">BOOST_PP_OVERLOAD</a>(MACRO_,__VA_ARGS__)(__VA_ARGS__)<br><br>#else<br><br>// or for Visual C++<br><br>#define MACRO_ADD_NUMBERS(...) \<br> <a
|
||||
href="cat.html">BOOST_PP_CAT</a>(<a href="overload.html">BOOST_PP_OVERLOAD</a>(MACRO_,__VA_ARGS__)(__VA_ARGS__),<a
|
||||
href="empty.html">BOOST_PP_EMPTY</a>())<br><br>#endif<br><br>MACRO_ADD_NUMBERS(5) // output is 15<br>MACRO_ADD_NUMBERS(3,6) // output is 9</pre>
|
||||
</div>
|
||||
<h4>Sample Code</h4>
|
||||
<div>
|
||||
<pre>#include <<a href="../headers/facilities/overload.html">boost/preprocessor/facilities/overload.hpp</a>><br>#include <<a href="../headers/cat.html">boost/preprocessor/cat.hpp</a>><br>#include <<a href="../headers/facilities/empty.html">boost/preprocessor/facilities/empty.hpp</a>><br>#include <<a href="../headers/arithmetic/add.html">boost/preprocessor/arithmetic/add.hpp</a>><br><br>#define MACRO_1(number) MACRO_2(number,10)<br>#define MACRO_2(number1,number2) <a href="add.html">BOOST_PP_ADD</a>(number1,number2)<br><br>#define MACRO_ADD_NUMBERS(...) <a href="overload.html">BOOST_PP_OVERLOAD</a>(MACRO_,__VA_ARGS__)(__VA_ARGS__)<br><br>// or for Visual C++<br><br>#define MACRO_ADD_NUMBERS(...) \<br> <a href="cat.html">BOOST_PP_CAT</a>(<a href="overload.html">BOOST_PP_OVERLOAD</a>(MACRO_,__VA_ARGS__)(__VA_ARGS__),<a href="empty.html">BOOST_PP_EMPTY</a>())<br><br>MACRO_ADD_NUMBERS(5) // output is 15<br>MACRO_ADD_NUMBERS(3,6) // output is 9<br></pre>
|
||||
</div>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i></i><i><EFBFBD> Copyright Edward Diener 2011,2013</i> </div>
|
||||
<div style="margin-left: 0px;">
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i></i><i><EFBFBD> Copyright Edward Diener 2011,2013,2016</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>
|
||||
(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>
|
@ -1,67 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_SEQ_REST_N</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_SEQ_REST_N</b> macro expands to a <i>seq</i> of all but the
|
||||
first <i>n</i> elements of a <i>seq</i>.
|
||||
</div>
|
||||
<h4>
|
||||
Usage
|
||||
</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_SEQ_REST_N</b>(<i>n</i>, <i>seq</i>)
|
||||
</div>
|
||||
<h4>
|
||||
Arguments
|
||||
</h4>
|
||||
<dl>
|
||||
<dt>n</dt>
|
||||
<dd>
|
||||
The number of elements to remove.
|
||||
</dd>
|
||||
<dt>seq</dt>
|
||||
<dd>
|
||||
The <i>seq</i> from which the elements are to be removed.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>
|
||||
Remarks
|
||||
</h4>
|
||||
<div>
|
||||
This macro extracts <i>n</i> elements from the beginning of <i>seq</i> and
|
||||
returns the remainder of <i>seq</i> as a new <i>seq</i>
|
||||
</div>
|
||||
<h4>
|
||||
See Also
|
||||
</h4>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="seq_first_n.html">BOOST_PP_SEQ_FIRST_N</a></li>
|
||||
</ul>
|
||||
<h4>
|
||||
Requirements
|
||||
</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/seq/rest_n.html"><boost/preprocessor/seq/rest_n.hpp></a>
|
||||
</div>
|
||||
<h4>
|
||||
Sample Code
|
||||
</h4>
|
||||
<div>
|
||||
<pre>#include <<a href="../headers/arithmetic/inc.html">boost/preprocessor/arithmetic/inc.hpp</a>><br>#include <<a href="../headers/seq/elem.html">boost/preprocessor/seq/elem.hpp</a>><br>#include <<a href="../headers/seq/first_n.html">boost/preprocessor/seq/first_n.hpp</a>><br>#include <<a href="../headers/seq/rest_n.html">boost/preprocessor/seq/rest_n.hpp</a>><br>#include <<a href="../headers/seq/size.html">boost/preprocessor/seq/size.hpp</a>><br><br>#define NUMBERS \<br> (0)(1)(2)(3)(4)(5)(6)(7)(8)(9) \<br> (10)(11)(12)(13)(14)(15)(16)(17)(18)(19) \<br> (20)(21)(22)(23)(24)(25)(26)(27)(28)(29) \<br> (30)(31)(32)(33)(34)(35)(36)(37)(38)(39) \<br> (40)(41)(42)(43)(44)(45)(46)(47)(48)(49) \<br> (50)(51)(52)(53)(54)(55)(56)(57)(58)(59) \<br> (60)(61)(62)(63)(64)(65)(66)(67)(68)(69) \<br> (70)(71)(72)(73)(74)(75)(76)(77)(78)(79) \<br> (80)(81)(82)(83)(84)(85)(86)(87)(88)(89) \<br> (90)(91)(92)(93)(94)(95)(96)(97)(98)(99) \<br> (100)(101)(102)(103)(104)(105)(106)(107)(108)(109) \<br> (110)(111)(112)(113)(114)(115)(116)(117)(118)(119) \<br> (120)(121)(122)(123)(124)(125)(126)(127)(128)(129) \<br> (130)(131)(132)(133)(134)(135)(136)(137)(138)(139) \<br> (140)(141)(142)(143)(144)(145)(146)(147)(148)(149) \<br> (150)(151)(152)(153)(154)(155)(156)(157)(158)(159) \<br> (160)(161)(162)(163)(164)(165)(166)(167)(168)(169) \<br> (170)(171)(172)(173)(174)(175)(176)(177)(178)(179) \<br> (180)(181)(182)(183)(184)(185)(186)(187)(188)(189) \<br> (190)(191)(192)(193)(194)(195)(196)(197)(198)(199) \<br> (200)(201)(202)(203)(204)(205)(206)(207)(208)(209) \<br> (210)(211)(212)(213)(214)(215)(216)(217)(218)(219) \<br> (220)(221)(222)(223)(224)(225)(226)(227)(228)(229) \<br> (230)(231)(232)(233)(234)(235)(236)(237)(238)(239) \<br> (240)(241)(242)(243)(244)(245)(246)(247)(248)(249) \<br> (250)(251)(252)(253)(254)(255)(256) \<br> /**/<br><br>#define SUPER_ADD(x, y) <a href="seq_elem.html">BOOST_PP_SEQ_ELEM</a>(y, <a href="seq_rest_n.html">BOOST_PP_SEQ_REST_N</a>(x, NUMBERS))<br><br>SUPER_ADD(100, 100) // expands to 200<br><br>#define SUPER_SUB(x, y) \<br> <a href="seq_size.html">BOOST_PP_SEQ_SIZE</a>( \<br> <a href="seq_rest_n.html">BOOST_PP_SEQ_REST_N</a>( \<br> <a href="inc.html">BOOST_PP_INC</a>(y), \<br> <a href="seq_first_n.html">BOOST_PP_SEQ_FIRST_N</a>( \<br> <a href="inc.html">BOOST_PP_INC</a>(x), NUMBERS \<br> ) \<br> ) \<br> ) \<br> /**/<br><br>SUPER_SUB(67, 25) // expands to 42<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>
|
||||
<br><i><EFBFBD> Copyright Paul Mensonides 2002</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>
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
|
||||
<title>BOOST_PP_SEQ_REST_N</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;"> The <b>BOOST_PP_SEQ_REST_N</b> macro
|
||||
expands to a <i>seq</i> of all but the first <i>n</i> elements of a <i>seq</i>.
|
||||
</div>
|
||||
<h4> Usage </h4>
|
||||
<div class="code"> <b>BOOST_PP_SEQ_REST_N</b>(<i>n</i>, <i>seq</i>) </div>
|
||||
<h4> Arguments </h4>
|
||||
<dl>
|
||||
<dt>n</dt>
|
||||
<dd> The number of elements to remove. </dd>
|
||||
<dt>seq</dt>
|
||||
<dd> The <i>seq</i> from which the elements are to be removed. </dd>
|
||||
</dl>
|
||||
<h4> Remarks </h4>
|
||||
<div> This macro extracts <i>n</i> elements from the beginning of <i>seq</i>
|
||||
and returns the remainder of <i>seq</i> as a new <i>seq.<br>
|
||||
<br>
|
||||
</i>It is undefined behavior if <i>n </i>is greater or equal to the size
|
||||
of the <i>seq</i>. </div>
|
||||
<h4> See Also </h4>
|
||||
<ul>
|
||||
<li> <a href="seq_first_n.html">BOOST_PP_SEQ_FIRST_N</a></li>
|
||||
</ul>
|
||||
<h4> Requirements </h4>
|
||||
<div> <b>Header:</b> <a href="../headers/seq/rest_n.html"><boost/preprocessor/seq/rest_n.hpp></a>
|
||||
</div>
|
||||
<h4> Sample Code </h4>
|
||||
<div>
|
||||
<pre>#include <<a href="../headers/arithmetic/inc.html">boost/preprocessor/arithmetic/inc.hpp</a>><br>#include <<a
|
||||
href="../headers/seq/elem.html">boost/preprocessor/seq/elem.hpp</a>><br>#include <<a
|
||||
href="../headers/seq/first_n.html">boost/preprocessor/seq/first_n.hpp</a>><br>#include <<a
|
||||
href="../headers/seq/rest_n.html">boost/preprocessor/seq/rest_n.hpp</a>><br>#include <<a
|
||||
href="../headers/seq/size.html">boost/preprocessor/seq/size.hpp</a>><br><br>#define NUMBERS \<br> (0)(1)(2)(3)(4)(5)(6)(7)(8)(9) \<br> (10)(11)(12)(13)(14)(15)(16)(17)(18)(19) \<br> (20)(21)(22)(23)(24)(25)(26)(27)(28)(29) \<br> (30)(31)(32)(33)(34)(35)(36)(37)(38)(39) \<br> (40)(41)(42)(43)(44)(45)(46)(47)(48)(49) \<br> (50)(51)(52)(53)(54)(55)(56)(57)(58)(59) \<br> (60)(61)(62)(63)(64)(65)(66)(67)(68)(69) \<br> (70)(71)(72)(73)(74)(75)(76)(77)(78)(79) \<br> (80)(81)(82)(83)(84)(85)(86)(87)(88)(89) \<br> (90)(91)(92)(93)(94)(95)(96)(97)(98)(99) \<br> (100)(101)(102)(103)(104)(105)(106)(107)(108)(109) \<br> (110)(111)(112)(113)(114)(115)(116)(117)(118)(119) \<br> (120)(121)(122)(123)(124)(125)(126)(127)(128)(129) \<br> (130)(131)(132)(133)(134)(135)(136)(137)(138)(139) \<br> (140)(141)(142)(143)(144)(145)(146)(147)(148)(149) \<br> (150)(151)(152)(153)(154)(155)(156)(157)(158)(159) \<br> (160)(161)(162)(163)(164)(165)(166)(167)(168)(169) \<br> (170)(171)(172)(173)(174)(175)(176)(177)(178)(179) \<br> (180)(181)(182)(183)(184)(185)(186)(187)(188)(189) \<br> (190)(191)(192)(193)(194)(195)(196)(197)(198)(199) \<br> (200)(201)(202)(203)(204)(205)(206)(207)(208)(209) \<br> (210)(211)(212)(213)(214)(215)(216)(217)(218)(219) \<br> (220)(221)(222)(223)(224)(225)(226)(227)(228)(229) \<br> (230)(231)(232)(233)(234)(235)(236)(237)(238)(239) \<br> (240)(241)(242)(243)(244)(245)(246)(247)(248)(249) \<br> (250)(251)(252)(253)(254)(255)(256) \<br> /**/<br><br>#define SUPER_ADD(x, y) <a
|
||||
href="seq_elem.html">BOOST_PP_SEQ_ELEM</a>(y, <a href="seq_rest_n.html">BOOST_PP_SEQ_REST_N</a>(x, NUMBERS))<br><br>SUPER_ADD(100, 100) // expands to 200<br><br>#define SUPER_SUB(x, y) \<br> <a
|
||||
href="seq_size.html">BOOST_PP_SEQ_SIZE</a>( \<br> <a href="seq_rest_n.html">BOOST_PP_SEQ_REST_N</a>( \<br> <a
|
||||
href="inc.html">BOOST_PP_INC</a>(y), \<br> <a href="seq_first_n.html">BOOST_PP_SEQ_FIRST_N</a>( \<br> <a
|
||||
href="inc.html">BOOST_PP_INC</a>(x), NUMBERS \<br> ) \<br> ) \<br> ) \<br> /**/<br><br>SUPER_SUB(67, 25) // expands to 42</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> <br>
|
||||
<i><EFBFBD> Copyright Paul Mensonides 2002</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="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>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;">
|
||||
<i><EFBFBD> Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
|
||||
|
@ -13,14 +13,14 @@
|
||||
code to check for the presence of variadic macro support. It can be
|
||||
used by the end-user for the same purpose. The macro equals 1 if
|
||||
variadic macros are supported and 0 if they are not. </div><b>Requirements</b>
|
||||
<div> <b>Header:</b> <a href="../headers/config/variadics.html"><boost/preprocessor/config/variadics.hpp></a>
|
||||
<div> <b>Header:</b> <a href="../headers/config/variadics.html"><boost/preprocessor/config/config.hpp></a>
|
||||
</div>
|
||||
<h4>Sample Code</h4>
|
||||
<div>
|
||||
<pre>#include <<a href="../headers/config/variadics.html">boost/preprocessor/config/variadics.hpp</a>><br><br>#if <a href="variadics.html">BOOST_PP_VARIADICS</a><br>#define SOME_MACRO(...) // replacement list<br>#else<br>#define SOME_MACRO(param1,param2) // replacement list<br>#endif<br></pre>
|
||||
<pre>#include <<a href="../headers/config/variadics.html">boost/preprocessor/config/config.hpp</a>><br><br>#if <a href="variadics.html">BOOST_PP_VARIADICS</a><br>#define SOME_MACRO(...) // replacement list<br>#else<br>#define SOME_MACRO(param1,param2) // replacement list<br>#endif<br></pre>
|
||||
</div>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i></i><i><EFBFBD> Copyright Edward Diener 2011</i> </div>
|
||||
<div style="margin-left: 0px;"> <i></i><i><EFBFBD> Copyright Edward Diener 2011,2014</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>
|
||||
|
@ -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>
|
||||
@ -29,10 +29,12 @@
|
||||
</ul>
|
||||
comparison<br>
|
||||
<ul>
|
||||
<li><a href="equal_d.html"><span style=" color: gray;">BOOST_PP_EQUAL_D</span></a></li>
|
||||
<li><a href="greater_d.html"><span style=" color: gray;">BOOST_PP_GREATER_D</span></a></li>
|
||||
<li><a href="greater_equal_d.html"><span style=" color: gray;">BOOST_PP_GREATER_EQUAL_D</span></a></li>
|
||||
<li><a href="less_d.html"><span style=" color: gray;">BOOST_PP_LESS_D</span></a></li>
|
||||
<li><a href="less_equal_d.html"><span style=" color: gray;">BOOST_PP_LESS_EQUAL_D</span></a></li>
|
||||
<li><a href="not_equal_d.html"><span style=" color: gray;">BOOST_PP_NOT_EQUAL_D</span></a></li>
|
||||
</ul>
|
||||
control<br>
|
||||
<ul>
|
||||
@ -51,6 +53,7 @@
|
||||
<li><a href="list_fold_right_d.html"><span style=" color: gray;">BOOST_PP_LIST_FOLD_RIGHT_d</span></a></li>
|
||||
<li><a href="list_rest_n_d.html"><span style=" color: gray;">BOOST_PP_LIST_REST_N_D</span></a></li>
|
||||
<li><a href="list_reverse_d.html"><span style=" color: gray;">BOOST_PP_LIST_REVERSE_D</span></a></li>
|
||||
<li><a href="list_size_d.html"><span style=" color: gray;">BOOST_PP_LIST_SIZE_D</span></a></li>
|
||||
<li><a href="list_to_array_d.html"><span style=" color: gray;">BOOST_PP_LIST_TO_ARRAY_D</span></a></li>
|
||||
<li><a href="list_transform_d.html"><span style=" color: gray;">BOOST_PP_LIST_TRANSFORM_D</span></a></li>
|
||||
</ul>
|
||||
|
@ -1,5 +1,6 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
|
||||
<title>title.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="styles.css">
|
||||
</head>
|
||||
@ -11,15 +12,14 @@
|
||||
may be used as a standalone library. </div>
|
||||
<div> An excerpt from <i>C++ Template Metaprogramming: Concepts, Tools, and
|
||||
Techniques from Boost and Beyond</i> by Dave Abrahams and Aleksey
|
||||
Gurtovoy has been made available <a href="http://www.boostpro.com/mplbook/preprocessor.html"
|
||||
target="_top"><font color="blue"><b><u><i>online</i></u></b></font></a>.
|
||||
Gurtovoy has been made <a href="AppendixA-AnIntroductiontoPreprocessorMetaprogramming.html"
|
||||
target="_top"><font color="blue"><b><u><i>available</i></u></b></font></a>.
|
||||
This excerpt contains a basic introduction to the Preprocessor library and
|
||||
preprocessor metaprogramming which may help users new to the library and
|
||||
users interested in seeing some of the facilities offered by the library.
|
||||
</div>
|
||||
<!--
|
||||
<EFBFBD> Copyright Housemarque Oy 2002<30> Copyright Paul Mensonides 2002
|
||||
Distributed under the Boost Software License, Version 1.0.(See accompanying file LICENSE_1_0.txt or copy at
|
||||
<EFBFBD> Copyright Housemarque Oy 2002<30> Copyright Paul Mensonides 2002Distributed 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)-->
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,40 +1,37 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset=windows-1252" http-equiv="content-type">
|
||||
<title>variadic_macros.html</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<style>
|
||||
u { font-weight: normal; text-decoration: none; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h4>Variadic Macros</h4>
|
||||
<div> Variadic macros are supported by a number of compilers.
|
||||
They are
|
||||
macros of the form:
|
||||
</div>
|
||||
<div class="code">
|
||||
<div> Variadic macros are supported by a number of compilers. They are
|
||||
macros of the form: </div>
|
||||
<div class="code">
|
||||
<pre>#define SOME_MACRO(ZeroOrMoreParameters,...) macro expansion possible specifying __VA_ARGS__</pre>
|
||||
</div>
|
||||
<div> The '...' in the parameter list represents the variadic
|
||||
data when the macro is invoked and the __VA_ARGS__ in the expansion
|
||||
represents the variadic data in the expansion of the macro. Variadic
|
||||
data is of the form of 1 or more preprocessor tokens separated by
|
||||
commas.<br>
|
||||
<div> The '...' in the parameter list represents the variadic data when the
|
||||
macro is invoked and the __VA_ARGS__ in the expansion represents the
|
||||
variadic data in the expansion of the macro. Variadic data is of the form
|
||||
of 1 or more preprocessor tokens separated by commas.<br>
|
||||
<br>
|
||||
The '...' must be the last parameter in the macro definition and there
|
||||
may be 0 or more non-variadic parameters preceding it.<br>
|
||||
The '...' must be the last parameter in the macro definition and there may
|
||||
be 0 or more non-variadic parameters preceding it.<br>
|
||||
<br>
|
||||
In the expansion of the macro __VA_ARGS__ may be specified 0 or more
|
||||
times to represent the variadic data. The variadic data in the
|
||||
expansion is a comma separated list of preprocessor tokens representing
|
||||
the variadic data which the invoker of the macro enters as the last
|
||||
arguments to the macro.<br>
|
||||
In the expansion of the macro __VA_ARGS__ may be specified 0 or more times
|
||||
to represent the variadic data. The variadic data in the expansion is a
|
||||
comma separated list of preprocessor tokens representing the variadic data
|
||||
which the invoker of the macro enters as the last arguments to the macro.<br>
|
||||
</div>
|
||||
<h4>Example<u> - Creating and invoking a variadic macro.</u></h4>
|
||||
<div class="code">
|
||||
<div class="code">
|
||||
<pre>#define INITIALIZE_INT_ARRAY(array_name,...) \ <br> static int array_name[] = { __VA_ARGS__ }; \ <br> /**/<br><br> INITIALIZE_INT_ARRAY(myname,45,789,33510,9346,2)</pre>
|
||||
</div>
|
||||
<u> <span style="font-weight: bold;">Preprocessor
|
||||
<u> <span style="font-weight: bold;">Preprocessor
|
||||
Library Support<br>
|
||||
</span></u>
|
||||
<div>The library offers support for variadic macros for those
|
||||
@ -56,7 +53,15 @@
|
||||
When BOOST_PP_VARIADICS is 1, the library offers some extended
|
||||
functionality
|
||||
by using variadic macros, and also offers extended support for working
|
||||
with variadic data.<br>
|
||||
with variadic data.<br><br>
|
||||
<a name="vmvcquirk"></a>Visual C++ has a
|
||||
few quirks related to variadic macros which require the end-user to code
|
||||
slightly differently. When BOOST_PP_VARIADICS is 1 and Visual C++ is the
|
||||
compiler BOOST_PP_VARIADICS_MSVC is 1, else when BOOST_PP_VARIADICS is 1
|
||||
and Visual C++ is not the compiler BOOST_PP_VARIADICS_MSVC is 0. When
|
||||
BOOST_PP_VARIADICS is 0 then BOOST_PP_VARIADICS_MSVC is not defined.
|
||||
In this way the end-user, when using variadic macros, can test for the
|
||||
presence of Visual C++ as the compiler and code accordingly.<br>
|
||||
<br>
|
||||
Support for working with variadic
|
||||
data is largely centered on being able to convert variadic data to
|
||||
@ -64,7 +69,7 @@
|
||||
functionality for working with those Boost preprocessor library data
|
||||
types is much greater than that for working with variadic data directly.<br>
|
||||
</div>
|
||||
<a name="VNotation"></a>
|
||||
<a name="VNotation"></a>
|
||||
<h4>Notation For Variadic Macros<br>
|
||||
</h4>
|
||||
<div>In the documentation, headers which have variadic macros,
|
||||
@ -131,7 +136,7 @@
|
||||
use this variadic data reliably as arguments to other macros, one needs
|
||||
variadic macro support.<br>
|
||||
</div>
|
||||
<u style="font-weight: bold;"> Using a Tuple Instead of an Array<br>
|
||||
<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
|
||||
first element is the array size and the second element is a tuple which
|
||||
@ -144,7 +149,7 @@
|
||||
type is essentially obsolete for conforming C++ compilers. Only if your
|
||||
compiler does not support variadic macros is the preprocessor array data
|
||||
type still useful.</div>
|
||||
<u style="font-weight: bold;">Using Variadic Data</u>
|
||||
<u style="font-weight: bold;">Using Variadic Data</u>
|
||||
<div>Variadic data exists in the
|
||||
form of comma-separated preprocessor tokens. This is the case whether
|
||||
the variadic data comes from the __VA_ARGS__ of a variadic macro, from
|
||||
@ -169,7 +174,7 @@
|
||||
variadic data as a whole to variadic macros as the last parameter of
|
||||
the macro. However: <br>
|
||||
<br>
|
||||
<span style="font-weight: bold;">Attempting to pass
|
||||
<span style="font-weight: bold;">Attempting to pass
|
||||
variadic data as a
|
||||
whole directly into a non-variadic macro is not guaranteed to work and
|
||||
may fail.<br>
|
||||
@ -178,7 +183,7 @@
|
||||
of compilers, currently most notably Visual C++. Even passing variadic
|
||||
data as arguments to a non-variadic macro, when it is not represented
|
||||
in
|
||||
the form of __VA_ARGS__, may fail with certain compilers.<br>
|
||||
the form of<EFBFBD> __VA_ARGS__, may fail with certain compilers.<br>
|
||||
<br>
|
||||
What follows are very simple examples, showing how variadic data can be
|
||||
passed to a non-variadic macro.<br>
|
||||
@ -188,9 +193,9 @@
|
||||
<h4>Example<u> - Passing variadic data as a whole to a
|
||||
non-variadic
|
||||
macro. DO NOT DO.</u></h4>
|
||||
<div class="code">
|
||||
<div class="code">
|
||||
<pre>#define MACRO_ARG_2(x,y) BOOST_PP_ADD(x,y)<br>#define VAR_MACRO(...) __VA_ARGS__<br><br>/* The following should not be done and is not guaranteed to work with compilers. */<br><br><span
|
||||
style="font-weight: bold;"><span style="font-family: monospace;"></span></span>int xx = MACRO_ARG_2(VAR_MACRO(2,3));</pre>
|
||||
style="font-weight: bold;"><span style="font-family: monospace;"></span></span>int xx = MACRO_ARG_2(VAR_MACRO(2,3));</pre>
|
||||
</div>
|
||||
<div> There are two ways to pass variadic data to a non-variadic
|
||||
macro.
|
||||
@ -203,7 +208,7 @@ style="font-weight: bold;"><span style="font-family: monospace;"></span></span>i
|
||||
a
|
||||
non-variadic macro.<br>
|
||||
</u></h4>
|
||||
<div class="code">
|
||||
<div class="code">
|
||||
<pre>#define MACRO_ARG_2(x,y) BOOST_PP_ADD(x,y)<br>#define VAR_MACRO(...) __VA_ARGS__<br><br>/* The following will work correctly */<br><br>int xx = MACRO_ARG_2<br> (<br> BOOST_PP_VARIADIC_ELEM(0,VAR_MACRO(2,3)),<br> BOOST_PP_VARIADIC_ELEM(1,VAR_MACRO(2,3))<br> );</pre>
|
||||
</div>
|
||||
<div>The second way is to use a macro in the library called
|
||||
@ -215,7 +220,7 @@ style="font-weight: bold;"><span style="font-family: monospace;"></span></span>i
|
||||
BOOST_PP_OVERLOAD
|
||||
and on to a non-variadic macro.<br>
|
||||
</u></h4>
|
||||
<div class="code">
|
||||
<div class="code">
|
||||
<pre>#define MACRO_ARG_2(x,y) BOOST_PP_ADD(x,y)<br>#define VAR_MACRO(...) __VA_ARGS__<br><br>/* The following will work correctly */<br><br>int xx = BOOST_PP_OVERLOAD(MACRO_ARG_,VAR_MACRO(2,3))(VAR_MACRO(2,3));<br><br>/* For Visual C++ it is necessary to do this */<br><br>int xx = <br>BOOST_PP_CAT(BOOST_PP_OVERLOAD(MACRO_ARG_,VAR_MACRO(2,3))(VAR_MACRO(2,3)),BOOST_PP_EMPTY());</pre>
|
||||
</div>
|
||||
<br>
|
||||
@ -230,27 +235,28 @@ style="font-weight: bold;"><span style="font-family: monospace;"></span></span>i
|
||||
</div>
|
||||
<b>See</b> <b>Also</b><br>
|
||||
<ul>
|
||||
<li><a href="../ref/variadics.html">BOOST_PP_VARIADICS</a></li>
|
||||
<li><a href="../headers/tuple.html">Tuple Macros</a><br>
|
||||
<li><a href="../ref/variadics.html">BOOST_PP_VARIADICS</a></li>
|
||||
<li><a href="../headers/tuple.html">Tuple Macros</a><br>
|
||||
</li>
|
||||
<li><a href="../headers/variadic.html">Variadic
|
||||
<li><a href="../headers/variadic.html">Variadic
|
||||
Macros<br>
|
||||
</a></li>
|
||||
<li><a href="../ref/array_enum.html">BOOST_PP_ARRAY_ENUM</a></li>
|
||||
<li><a href="../ref/list_enum_r.html">BOOST_PP_LIST_ENUM</a></li>
|
||||
<li><a href="../ref/seq_enum.html">BOOST_PP_SEQ_ENUM</a></li>
|
||||
<li><a href="../ref/tuple_enum.html">BOOST_PP_TUPLE_ENUM</a></li>
|
||||
<li><a href="../ref/overload.html">BOOST_PP_OVERLOAD</a></li>
|
||||
<li><a href="../ref/array_enum.html">BOOST_PP_ARRAY_ENUM</a></li>
|
||||
<li><a href="../ref/list_enum_r.html">BOOST_PP_LIST_ENUM</a></li>
|
||||
<li><a href="../ref/seq_enum.html">BOOST_PP_SEQ_ENUM</a></li>
|
||||
<li><a href="../ref/tuple_enum.html">BOOST_PP_TUPLE_ENUM</a></li>
|
||||
<li><a href="../ref/overload.html">BOOST_PP_OVERLOAD</a></li>
|
||||
</ul>
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i><EFBFBD> Copyright
|
||||
<hr size="1">
|
||||
<div style="margin-left: 0px;"> <i><EFBFBD> Copyright
|
||||
Edward Diener
|
||||
2011,2013</i> </div>
|
||||
<div style="margin-left: 0px;">
|
||||
2011,2013,2016</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>
|
||||
(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>
|
@ -284,5 +284,6 @@
|
||||
# define BOOST_PP_DEC_254 253
|
||||
# define BOOST_PP_DEC_255 254
|
||||
# define BOOST_PP_DEC_256 255
|
||||
# define BOOST_PP_DEC_257 256
|
||||
#
|
||||
# endif
|
||||
|
@ -25,7 +25,7 @@
|
||||
# define BOOST_PP_CAT_OO(par) BOOST_PP_CAT_I ## par
|
||||
# endif
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
||||
# if (~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 1700)
|
||||
# define BOOST_PP_CAT_I(a, b) a ## b
|
||||
# else
|
||||
# define BOOST_PP_CAT_I(a, b) BOOST_PP_CAT_II(~, a ## b)
|
||||
|
@ -25,18 +25,16 @@
|
||||
# define BOOST_PP_CONFIG_DMC() 0x0040
|
||||
#
|
||||
# ifndef BOOST_PP_CONFIG_FLAGS
|
||||
# if defined(__GCCXML__)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# elif defined(__WAVE__)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# elif defined(__MWERKS__) && __MWERKS__ >= 0x3200
|
||||
# if defined(__GCCXML__) || defined(__WAVE__) || defined(__MWERKS__) && __MWERKS__ >= 0x3200
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# elif defined(__EDG__) || defined(__EDG_VERSION__)
|
||||
# if defined(_MSC_VER) && __EDG_VERSION__ >= 308
|
||||
# if defined(_MSC_VER) && !defined(__clang__) && (defined(__INTELLISENSE__) || __EDG_VERSION__ >= 308)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC())
|
||||
# else
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_EDG() | BOOST_PP_CONFIG_STRICT())
|
||||
# endif
|
||||
# elif defined(_MSC_VER) && defined(__clang__)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# elif defined(__MWERKS__)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MWCC())
|
||||
# elif defined(__DMC__)
|
||||
@ -45,7 +43,7 @@
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
# elif defined(__BORLANDC__) || defined(__IBMC__) || defined(__IBMCPP__) || defined(__SUNPRO_CC)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_BCC())
|
||||
# elif defined(_MSC_VER) && !defined(__clang__)
|
||||
# elif defined(_MSC_VER)
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_MSVC())
|
||||
# else
|
||||
# define BOOST_PP_CONFIG_FLAGS() (BOOST_PP_CONFIG_STRICT())
|
||||
@ -70,16 +68,22 @@
|
||||
#
|
||||
# /* BOOST_PP_VARIADICS */
|
||||
#
|
||||
# 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 || defined __HP_aCC && !defined __EDG__ || defined __MRC__ || defined __SC__ || defined __IBMCPP__ || defined __PGI
|
||||
# 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
|
||||
# define BOOST_PP_VARIADICS 0
|
||||
# /* VC++ (C/C++) */
|
||||
# elif defined _MSC_VER && _MSC_VER >= 1400 && !defined __EDG__ && !defined __clang__
|
||||
# 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
|
||||
# /* Wave (C/C++), GCC (C++) */
|
||||
# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && __GXX_EXPERIMENTAL_CXX0X__
|
||||
# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && defined __GXX_EXPERIMENTAL_CXX0X__ && __GXX_EXPERIMENTAL_CXX0X__
|
||||
# define BOOST_PP_VARIADICS 1
|
||||
# elif defined __CUDACC__
|
||||
# define BOOST_PP_VARIADICS 1
|
||||
# /* EDG-based (C/C++), GCC (C), and unknown (C/C++) */
|
||||
# elif !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L
|
||||
@ -90,7 +94,8 @@
|
||||
# elif !BOOST_PP_VARIADICS + 1 < 2
|
||||
# undef BOOST_PP_VARIADICS
|
||||
# define BOOST_PP_VARIADICS 1
|
||||
# if defined _MSC_VER && _MSC_VER >= 1400 && !(defined __EDG__ || defined __GCCXML__ || defined __CUDACC__ || defined __PATHSCALE__ || defined __clang__ || 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 __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))
|
||||
# undef BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_VARIADICS_MSVC 1
|
||||
# endif
|
||||
# else
|
||||
|
@ -8,6 +8,7 @@
|
||||
# */
|
||||
#
|
||||
# /* Revised by Paul Mensonides (2002) */
|
||||
# /* Revised by Edward Diener (2015) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
@ -15,9 +16,12 @@
|
||||
# define BOOST_PREPROCESSOR_FACILITIES_IDENTITY_HPP
|
||||
#
|
||||
# include <boost/preprocessor/facilities/empty.hpp>
|
||||
# include <boost/preprocessor/tuple/eat.hpp>
|
||||
#
|
||||
# /* BOOST_PP_IDENTITY */
|
||||
#
|
||||
# define BOOST_PP_IDENTITY(item) item BOOST_PP_EMPTY
|
||||
#
|
||||
# define BOOST_PP_IDENTITY_N(item,n) item BOOST_PP_TUPLE_EAT_N(n)
|
||||
#
|
||||
# endif
|
||||
|
@ -21,7 +21,6 @@
|
||||
#
|
||||
# else
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() && ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
# include <boost/preprocessor/facilities/identity.hpp>
|
||||
|
@ -32,5 +32,6 @@
|
||||
# include <boost/preprocessor/stringize.hpp>
|
||||
# include <boost/preprocessor/tuple.hpp>
|
||||
# include <boost/preprocessor/variadic.hpp>
|
||||
# include <boost/preprocessor/wstringize.hpp>
|
||||
#
|
||||
# endif
|
||||
|
@ -16,6 +16,8 @@
|
||||
#
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/debug/error.hpp>
|
||||
# include <boost/preprocessor/facilities/empty.hpp>
|
||||
# include <boost/preprocessor/logical/bool.hpp>
|
||||
# include <boost/preprocessor/detail/auto_rec.hpp>
|
||||
#
|
||||
# /* BOOST_PP_FOR */
|
||||
@ -42,7 +44,23 @@
|
||||
# include <boost/preprocessor/repetition/detail/for.hpp>
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_FOR_257(s, p, o, m) BOOST_PP_ERROR(0x0002)
|
||||
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
|
||||
# define BOOST_PP_FOR_257_PR(s, p) BOOST_PP_BOOL(p##(257, s))
|
||||
# else
|
||||
# define BOOST_PP_FOR_257_PR(s, p) BOOST_PP_BOOL(p(257, s))
|
||||
# endif
|
||||
|
||||
# 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 \
|
||||
) \
|
||||
() \
|
||||
/**/
|
||||
// # define BOOST_PP_FOR_257(s, p, o, m) BOOST_PP_ERROR(0x0002)
|
||||
#
|
||||
# define BOOST_PP_FOR_CHECK_BOOST_PP_NIL 1
|
||||
#
|
||||
|
@ -30,14 +30,13 @@
|
||||
# endif
|
||||
# if BOOST_PP_VARIADICS
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(...) \
|
||||
BOOST_PP_VARIADIC_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,__VA_ARGS__) \
|
||||
/**/
|
||||
# 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
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(...) BOOST_PP_REM
|
||||
# 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
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_A(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(__VA_ARGS__), __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_B
|
||||
# define BOOST_PP_SEQ_BINARY_TRANSFORM_B(...) (BOOST_PP_SEQ_BINARY_TRANSFORM_GET_REM(__VA_ARGS__), __VA_ARGS__)() BOOST_PP_SEQ_BINARY_TRANSFORM_A
|
||||
# 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
|
||||
|
49
include/boost/preprocessor/seq/detail/is_empty.hpp
Normal file
49
include/boost/preprocessor/seq/detail/is_empty.hpp
Normal file
@ -0,0 +1,49 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2015.
|
||||
# * 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_SEQ_DETAIL_IS_EMPTY_HPP
|
||||
# define BOOST_PREPROCESSOR_SEQ_DETAIL_IS_EMPTY_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
# include <boost/preprocessor/logical/bool.hpp>
|
||||
# include <boost/preprocessor/logical/compl.hpp>
|
||||
# include <boost/preprocessor/seq/size.hpp>
|
||||
#
|
||||
/* 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) \
|
||||
) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_IS_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)) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY_SIZE(size) \
|
||||
BOOST_PP_BOOL(size) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_EMPTY_SIZE(seq) \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq (nil))) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
55
include/boost/preprocessor/seq/detail/to_list_msvc.hpp
Normal file
55
include/boost/preprocessor/seq/detail/to_list_msvc.hpp
Normal file
@ -0,0 +1,55 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2016. *
|
||||
# * 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_SEQ_DETAIL_TO_LIST_MSVC_HPP
|
||||
# define BOOST_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
||||
#
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
# include <boost/preprocessor/control/while.hpp>
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT(state) \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, state) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state) \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, state) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_PRED(d,state) \
|
||||
BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state) \
|
||||
/**/
|
||||
# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_OP(d,state) \
|
||||
( \
|
||||
BOOST_PP_CAT(BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT(state),), \
|
||||
BOOST_PP_DEC(BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_SIZE(state)) \
|
||||
) \
|
||||
/**/
|
||||
#
|
||||
# /* BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC */
|
||||
#
|
||||
# define BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC(result,seqsize) \
|
||||
BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_STATE_RESULT \
|
||||
( \
|
||||
BOOST_PP_WHILE \
|
||||
( \
|
||||
BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_PRED, \
|
||||
BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC_OP, \
|
||||
(result,seqsize) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
# endif // BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
||||
#
|
||||
# endif // BOOST_PREPROCESSOR_SEQ_DETAIL_TO_LIST_MSVC_HPP
|
@ -14,47 +14,94 @@
|
||||
#
|
||||
# include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/control/if.hpp>
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/repetition/for.hpp>
|
||||
# include <boost/preprocessor/seq/seq.hpp>
|
||||
# include <boost/preprocessor/seq/size.hpp>
|
||||
# include <boost/preprocessor/seq/detail/is_empty.hpp>
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
# include <boost/preprocessor/tuple/rem.hpp>
|
||||
#
|
||||
# /* BOOST_PP_SEQ_FOR_EACH */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_FOR((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
|
||||
# define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK(macro, data, seq)
|
||||
# else
|
||||
# define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq) BOOST_PP_FOR((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK(macro, data, seq)
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_P(r, x) BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(3, 2, x)))
|
||||
# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC(macro, data, seq) BOOST_PP_FOR((macro, data, seq, BOOST_PP_SEQ_SIZE(seq)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
|
||||
# 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) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_P(r, x) BOOST_PP_TUPLE_ELEM(4, 3, x)
|
||||
#
|
||||
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I x
|
||||
# else
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I(BOOST_PP_TUPLE_ELEM(3, 0, x), BOOST_PP_TUPLE_ELEM(3, 1, x), BOOST_PP_TUPLE_ELEM(3, 2, x))
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I(BOOST_PP_TUPLE_ELEM(4, 0, x), BOOST_PP_TUPLE_ELEM(4, 1, x), BOOST_PP_TUPLE_ELEM(4, 2, x), BOOST_PP_TUPLE_ELEM(4, 3, x))
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_O_I(macro, data, seq) (macro, data, BOOST_PP_SEQ_TAIL(seq))
|
||||
# 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)) \
|
||||
/**/
|
||||
# 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 \
|
||||
) \
|
||||
/**/
|
||||
# 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
|
||||
#
|
||||
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
|
||||
# define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_IM(r, BOOST_PP_TUPLE_REM_3 x)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_IM(r, BOOST_PP_TUPLE_REM_4 x)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_M_IM(r, im) BOOST_PP_SEQ_FOR_EACH_M_I(r, im)
|
||||
# else
|
||||
# define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_I(r, BOOST_PP_TUPLE_ELEM(3, 0, x), BOOST_PP_TUPLE_ELEM(3, 1, x), BOOST_PP_TUPLE_ELEM(3, 2, x))
|
||||
# define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_I(r, BOOST_PP_TUPLE_ELEM(4, 0, x), BOOST_PP_TUPLE_ELEM(4, 1, x), BOOST_PP_TUPLE_ELEM(4, 2, x), BOOST_PP_TUPLE_ELEM(4, 3, x))
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_M_I(r, macro, data, seq) macro(r, data, BOOST_PP_SEQ_HEAD(seq))
|
||||
# define BOOST_PP_SEQ_FOR_EACH_M_I(r, macro, data, seq, sz) macro(r, data, BOOST_PP_SEQ_HEAD(seq))
|
||||
#
|
||||
# /* BOOST_PP_SEQ_FOR_EACH_R */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_R(r, macro, data, seq)
|
||||
# else
|
||||
# define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_R(r, macro, data, seq)
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_DETAIL_CHECK_EXEC_R(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq, BOOST_PP_SEQ_SIZE(seq)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
|
||||
# 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) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -15,47 +15,95 @@
|
||||
# include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
# include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/control/if.hpp>
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/repetition/for.hpp>
|
||||
# include <boost/preprocessor/seq/seq.hpp>
|
||||
# include <boost/preprocessor/seq/size.hpp>
|
||||
# include <boost/preprocessor/seq/detail/is_empty.hpp>
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
# include <boost/preprocessor/tuple/rem.hpp>
|
||||
#
|
||||
# /* BOOST_PP_SEQ_FOR_EACH_I */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I(macro, data, seq) BOOST_PP_FOR((macro, data, seq (nil), 0), BOOST_PP_SEQ_FOR_EACH_I_P, BOOST_PP_SEQ_FOR_EACH_I_O, BOOST_PP_SEQ_FOR_EACH_I_M)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK(macro, data, seq)
|
||||
# else
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_I_I(macro, data, seq)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_I(macro, data, seq) BOOST_PP_FOR((macro, data, seq (nil), 0), BOOST_PP_SEQ_FOR_EACH_I_P, BOOST_PP_SEQ_FOR_EACH_I_O, BOOST_PP_SEQ_FOR_EACH_I_M)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_I(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK(macro, data, seq)
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_P(r, x) BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(4, 2, x)))
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_DETAIL_CHECK_EXEC(macro, data, seq) BOOST_PP_FOR((macro, data, seq, 0, BOOST_PP_SEQ_SIZE(seq)), BOOST_PP_SEQ_FOR_EACH_I_P, BOOST_PP_SEQ_FOR_EACH_I_O, BOOST_PP_SEQ_FOR_EACH_I_M)
|
||||
# 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) \
|
||||
/**/
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_P(r, x) BOOST_PP_TUPLE_ELEM(5, 4, x)
|
||||
#
|
||||
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O(r, x) BOOST_PP_SEQ_FOR_EACH_I_O_I x
|
||||
# else
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O(r, x) BOOST_PP_SEQ_FOR_EACH_I_O_I(BOOST_PP_TUPLE_ELEM(4, 0, x), BOOST_PP_TUPLE_ELEM(4, 1, x), BOOST_PP_TUPLE_ELEM(4, 2, x), BOOST_PP_TUPLE_ELEM(4, 3, x))
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O(r, x) BOOST_PP_SEQ_FOR_EACH_I_O_I(BOOST_PP_TUPLE_ELEM(5, 0, x), BOOST_PP_TUPLE_ELEM(5, 1, x), BOOST_PP_TUPLE_ELEM(5, 2, x), BOOST_PP_TUPLE_ELEM(5, 3, x), BOOST_PP_TUPLE_ELEM(5, 4, x))
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_O_I(macro, data, seq, i) (macro, data, BOOST_PP_SEQ_TAIL(seq), BOOST_PP_INC(i))
|
||||
# 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)) \
|
||||
/**/
|
||||
# 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 \
|
||||
) \
|
||||
/**/
|
||||
# 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
|
||||
#
|
||||
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_M(r, x) BOOST_PP_SEQ_FOR_EACH_I_M_IM(r, BOOST_PP_TUPLE_REM_4 x)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_M(r, x) BOOST_PP_SEQ_FOR_EACH_I_M_IM(r, BOOST_PP_TUPLE_REM_5 x)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_M_IM(r, im) BOOST_PP_SEQ_FOR_EACH_I_M_I(r, im)
|
||||
# else
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_M(r, x) BOOST_PP_SEQ_FOR_EACH_I_M_I(r, BOOST_PP_TUPLE_ELEM(4, 0, x), BOOST_PP_TUPLE_ELEM(4, 1, x), BOOST_PP_TUPLE_ELEM(4, 2, x), BOOST_PP_TUPLE_ELEM(4, 3, x))
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_M(r, x) BOOST_PP_SEQ_FOR_EACH_I_M_I(r, BOOST_PP_TUPLE_ELEM(5, 0, x), BOOST_PP_TUPLE_ELEM(5, 1, x), BOOST_PP_TUPLE_ELEM(5, 2, x), BOOST_PP_TUPLE_ELEM(5, 3, x), BOOST_PP_TUPLE_ELEM(5, 4, x))
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_M_I(r, macro, data, seq, i) macro(r, data, i, BOOST_PP_SEQ_HEAD(seq))
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_M_I(r, macro, data, seq, i, sz) macro(r, data, i, BOOST_PP_SEQ_HEAD(seq))
|
||||
#
|
||||
# /* BOOST_PP_SEQ_FOR_EACH_I_R */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_R(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq (nil), 0), BOOST_PP_SEQ_FOR_EACH_I_P, BOOST_PP_SEQ_FOR_EACH_I_O, BOOST_PP_SEQ_FOR_EACH_I_M)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_R(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK(r, macro, data, seq)
|
||||
# else
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_R(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_I_R_I(r, macro, data, seq)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_R_I(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq (nil), 0), BOOST_PP_SEQ_FOR_EACH_I_P, BOOST_PP_SEQ_FOR_EACH_I_O, BOOST_PP_SEQ_FOR_EACH_I_M)
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_R_I(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK(r, macro, data, seq)
|
||||
# endif
|
||||
#
|
||||
# define BOOST_PP_SEQ_FOR_EACH_I_R_DETAIL_CHECK_EXEC(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq, 0, BOOST_PP_SEQ_SIZE(seq)), BOOST_PP_SEQ_FOR_EACH_I_P, BOOST_PP_SEQ_FOR_EACH_I_O, BOOST_PP_SEQ_FOR_EACH_I_M)
|
||||
# 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) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -12,18 +12,34 @@
|
||||
# ifndef BOOST_PREPROCESSOR_SEQ_REPLACE_HPP
|
||||
# define BOOST_PREPROCESSOR_SEQ_REPLACE_HPP
|
||||
#
|
||||
# include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
# include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/comparison/equal.hpp>
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/seq/first_n.hpp>
|
||||
# include <boost/preprocessor/seq/rest_n.hpp>
|
||||
# include <boost/preprocessor/seq/size.hpp>
|
||||
#
|
||||
# /* BOOST_PP_SEQ_REPLACE */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_SEQ_REPLACE(seq, i, elem) BOOST_PP_SEQ_FIRST_N(i, seq) (elem) BOOST_PP_SEQ_REST_N(BOOST_PP_INC(i), seq)
|
||||
# define BOOST_PP_SEQ_REPLACE(seq, i, elem) BOOST_PP_SEQ_FIRST_N(i, seq) (elem) BOOST_PP_SEQ_REPLACE_DETAIL_REST(seq, i)
|
||||
# else
|
||||
# define BOOST_PP_SEQ_REPLACE(seq, i, elem) BOOST_PP_SEQ_REPLACE_I(seq, i, elem)
|
||||
# define BOOST_PP_SEQ_REPLACE_I(seq, i, elem) BOOST_PP_SEQ_FIRST_N(i, seq) (elem) BOOST_PP_SEQ_REST_N(BOOST_PP_INC(i), seq)
|
||||
# define BOOST_PP_SEQ_REPLACE_I(seq, i, elem) BOOST_PP_SEQ_FIRST_N(i, seq) (elem) BOOST_PP_SEQ_REPLACE_DETAIL_REST(seq, i)
|
||||
# endif
|
||||
#
|
||||
# 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) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -13,18 +13,34 @@
|
||||
# define BOOST_PREPROCESSOR_SEQ_REST_N_HPP
|
||||
#
|
||||
# include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
# include <boost/preprocessor/comparison/not_equal.hpp>
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
# include <boost/preprocessor/control/expr_iif.hpp>
|
||||
# include <boost/preprocessor/facilities/identity.hpp>
|
||||
# include <boost/preprocessor/logical/bitand.hpp>
|
||||
# include <boost/preprocessor/seq/detail/is_empty.hpp>
|
||||
# include <boost/preprocessor/seq/detail/split.hpp>
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
#
|
||||
# /* BOOST_PP_SEQ_REST_N */
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
|
||||
# define BOOST_PP_SEQ_REST_N(n, seq) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), BOOST_PP_IDENTITY( (nil) seq )))()
|
||||
# define BOOST_PP_SEQ_REST_N(n, seq) BOOST_PP_SEQ_REST_N_DETAIL_EXEC(n, seq, BOOST_PP_SEQ_DETAIL_EMPTY_SIZE(seq))
|
||||
# else
|
||||
# define BOOST_PP_SEQ_REST_N(n, seq) BOOST_PP_SEQ_REST_N_I(n, seq)
|
||||
# define BOOST_PP_SEQ_REST_N_I(n, seq) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_SEQ_SPLIT(BOOST_PP_INC(n), BOOST_PP_IDENTITY( (nil) seq )))()
|
||||
# define BOOST_PP_SEQ_REST_N_I(n, seq) BOOST_PP_SEQ_REST_N_DETAIL_EXEC(n, seq, BOOST_PP_SEQ_DETAIL_EMPTY_SIZE(seq))
|
||||
# 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 )))() \
|
||||
) \
|
||||
/**/
|
||||
#
|
||||
# endif
|
||||
|
@ -543,5 +543,6 @@
|
||||
# define BOOST_PP_SEQ_SIZE_BOOST_PP_SEQ_SIZE_254 254
|
||||
# define BOOST_PP_SEQ_SIZE_BOOST_PP_SEQ_SIZE_255 255
|
||||
# define BOOST_PP_SEQ_SIZE_BOOST_PP_SEQ_SIZE_256 256
|
||||
# define BOOST_PP_SEQ_SIZE_BOOST_PP_SEQ_SIZE_257 257
|
||||
#
|
||||
# endif
|
||||
|
@ -19,7 +19,19 @@
|
||||
#
|
||||
# /* BOOST_PP_SEQ_TO_LIST */
|
||||
#
|
||||
# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
|
||||
# include <boost/preprocessor/seq/size.hpp>
|
||||
# include <boost/preprocessor/seq/detail/to_list_msvc.hpp>
|
||||
# define BOOST_PP_SEQ_TO_LIST(seq) \
|
||||
BOOST_PP_SEQ_DETAIL_TO_LIST_MSVC \
|
||||
( \
|
||||
BOOST_PP_SEQ_TO_LIST_I(BOOST_PP_SEQ_BINARY_TRANSFORM(seq)), \
|
||||
BOOST_PP_SEQ_SIZE(seq) \
|
||||
) \
|
||||
/**/
|
||||
# else
|
||||
# define BOOST_PP_SEQ_TO_LIST(seq) BOOST_PP_SEQ_TO_LIST_I(BOOST_PP_SEQ_BINARY_TRANSFORM(seq))
|
||||
# endif
|
||||
# define BOOST_PP_SEQ_TO_LIST_I(bseq) BOOST_PP_SEQ_TO_LIST_A bseq BOOST_PP_NIL BOOST_PP_SEQ_TO_LIST_B bseq
|
||||
# define BOOST_PP_SEQ_TO_LIST_A(m, e) m(BOOST_PP_LPAREN() e BOOST_PP_COMMA() BOOST_PP_SEQ_TO_LIST_A_ID)
|
||||
# define BOOST_PP_SEQ_TO_LIST_A_ID() BOOST_PP_SEQ_TO_LIST_A
|
||||
|
@ -8,7 +8,7 @@
|
||||
# */
|
||||
#
|
||||
# /* Revised by Paul Mensonides (2002-2011) */
|
||||
# /* Revised by Edward Diener (2011) */
|
||||
# /* Revised by Edward Diener (2011,2015) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
@ -38,6 +38,15 @@
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_EAT_I(size) BOOST_PP_TUPLE_EAT_ ## size
|
||||
# endif
|
||||
#
|
||||
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
|
||||
# define BOOST_PP_TUPLE_EAT_N(size) BOOST_PP_TUPLE_EAT_N_I(size)
|
||||
# else
|
||||
# define BOOST_PP_TUPLE_EAT_N(size) BOOST_PP_TUPLE_EAT_N_OO((size))
|
||||
# define BOOST_PP_TUPLE_EAT_N_OO(par) BOOST_PP_TUPLE_EAT_N_I ## par
|
||||
# endif
|
||||
# define BOOST_PP_TUPLE_EAT_N_I(size) BOOST_PP_TUPLE_EAT_ ## size
|
||||
#
|
||||
# define BOOST_PP_TUPLE_EAT_1(e0)
|
||||
# define BOOST_PP_TUPLE_EAT_2(e0, e1)
|
||||
# define BOOST_PP_TUPLE_EAT_3(e0, e1, e2)
|
||||
|
@ -27,14 +27,14 @@
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# define BOOST_PP_TUPLE_ELEM(...) BOOST_PP_TUPLE_ELEM_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_ELEM_O_, __VA_ARGS__), (__VA_ARGS__))
|
||||
# define BOOST_PP_TUPLE_ELEM_I(m, args) BOOST_PP_TUPLE_ELEM_II(m, args)
|
||||
# define BOOST_PP_TUPLE_ELEM_II(m, args) BOOST_PP_CAT(BOOST_PP_EXPAND(m ## args),)
|
||||
# define BOOST_PP_TUPLE_ELEM_II(m, args) BOOST_PP_CAT(m ## args,)
|
||||
/*
|
||||
Use BOOST_PP_REM_CAT if it is a single element tuple ( which might be empty )
|
||||
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_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) 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__)
|
||||
|
@ -123,8 +123,8 @@
|
||||
# if BOOST_PP_VARIADICS_MSVC
|
||||
# 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(BOOST_PP_EXPAND(m ## args),)
|
||||
# define BOOST_PP_TUPLE_REM_CTOR_O_1(tuple) BOOST_PP_TUPLE_IS_SINGLE_RETURN(BOOST_PP_REM_CAT,BOOST_PP_REM,tuple) tuple
|
||||
# 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)
|
||||
# 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
|
||||
|
149
test/Jamfile.v2
149
test/Jamfile.v2
@ -17,27 +17,42 @@ project preprocessor_tests : requirements <warnings>on
|
||||
<toolset>msvc:<warnings>all
|
||||
;
|
||||
|
||||
test-suite preprocessor
|
||||
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:<cxxflags>-std=c++0x ]
|
||||
[ compile array.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile comparison.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile control.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile debug.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile facilities.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile iteration.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile list.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile logical.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile punctuation.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile repetition.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile selection.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile seq.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile slot.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile tuple.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile variadic.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ 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 ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_nvm
|
||||
alias preprocessor_nvm
|
||||
:
|
||||
[ compile arithmetic.cpp : <define>BOOST_PP_VARIADICS=0 : arithmetic_nvm ]
|
||||
[ compile array.cpp : <define>BOOST_PP_VARIADICS=0 : array_nvm ]
|
||||
@ -55,163 +70,183 @@ test-suite preprocessor_nvm
|
||||
[ compile tuple.cpp : <define>BOOST_PP_VARIADICS=0 : tuple_nvm ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_c
|
||||
alias preprocessor_c
|
||||
:
|
||||
[ compile arithmetic.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: arithmetic_c
|
||||
]
|
||||
[ compile array.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: array_c
|
||||
]
|
||||
[ compile comparison.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: comparison_c
|
||||
]
|
||||
[ compile control.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: control_c
|
||||
]
|
||||
[ compile debug.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: debug_c
|
||||
]
|
||||
[ compile facilities.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: facilities_c
|
||||
]
|
||||
[ compile list.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: list_c
|
||||
]
|
||||
[ compile logical.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: logical_c
|
||||
]
|
||||
[ compile punctuation.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: punctuation_c
|
||||
]
|
||||
[ compile selection.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: selection_c
|
||||
]
|
||||
[ compile seq.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: seq_c
|
||||
]
|
||||
[ compile slot.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: slot_c
|
||||
]
|
||||
[ compile tuple.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: tuple_c
|
||||
]
|
||||
[ compile variadic.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: variadic_c
|
||||
]
|
||||
;
|
||||
|
||||
test-suite preprocessor_c_nvm
|
||||
alias preprocessor_c_nvm
|
||||
:
|
||||
[ compile arithmetic.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: arithmetic_c_nvm
|
||||
]
|
||||
[ compile array.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: array_c_nvm
|
||||
]
|
||||
[ compile comparison.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<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:<cflags>-std=c99
|
||||
<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:<cflags>-std=c99
|
||||
<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:<cflags>-std=c99
|
||||
<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:<cflags>-std=c99
|
||||
<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:<cflags>-std=c99
|
||||
<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:<cflags>-std=c99
|
||||
<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:<cflags>-std=c99
|
||||
<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:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: slot_c_nvm
|
||||
]
|
||||
[ compile tuple.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: tuple_c_nvm
|
||||
]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty
|
||||
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:<cxxflags>-std=c++0x ]
|
||||
[ compile-fail isempty_variadic_standard_failure.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ compile-fail isempty_variadic_standard_failure2.cpp : <toolset>gcc:<cxxflags>-std=c++0x <toolset>clang:<cxxflags>-std=c++0x ]
|
||||
[ 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 ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty_nvm
|
||||
alias preprocessor_isempty_nvm
|
||||
:
|
||||
[ compile isempty.cpp : <define>BOOST_PP_VARIADICS=0 : isempty_nvm ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty_c
|
||||
alias preprocessor_isempty_c
|
||||
:
|
||||
[ compile isempty.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <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:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: isempty_variadic_standard_failure_c
|
||||
]
|
||||
[ compile-fail isempty_variadic_standard_failure2.c
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
: <toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: isempty_variadic_standard_failure2_c
|
||||
]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty_c_nvm
|
||||
alias preprocessor_isempty_c_nvm
|
||||
:
|
||||
[ compile isempty.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang:<cflags>-std=c99
|
||||
<toolset>gcc:<cflags>-std=c99 <toolset>clang-linux:<cflags>-std=c99
|
||||
: isempty_c_nvm
|
||||
]
|
||||
;
|
||||
|
||||
alias preprocessor_config
|
||||
:
|
||||
[ run config_info.cpp ]
|
||||
;
|
||||
|
93
test/config_info.cpp
Normal file
93
test/config_info.cpp
Normal file
@ -0,0 +1,93 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <string.h>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
|
||||
static unsigned int indent = 4;
|
||||
static unsigned int width = 40;
|
||||
|
||||
using std::cout;
|
||||
using std::istream;
|
||||
|
||||
void print_separator()
|
||||
{
|
||||
std::cout <<
|
||||
"\n\n*********************************************************************\n\n";
|
||||
}
|
||||
|
||||
void print_macro(const char* name, const char* value)
|
||||
{
|
||||
// if name == value+1 then then macro is not defined,
|
||||
// in which case we don't print anything:
|
||||
if(0 != strcmp(name, value+1))
|
||||
{
|
||||
for(unsigned i = 0; i < indent; ++i) std::cout.put(' ');
|
||||
std::cout << std::setw(width);
|
||||
cout.setf(istream::left, istream::adjustfield);
|
||||
std::cout << name;
|
||||
if(value[1])
|
||||
{
|
||||
// macro has a value:
|
||||
std::cout << value << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
// macro is defined but has no value:
|
||||
std::cout << " [no value]\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define PRINT_MACRO(X) print_macro(#X, BOOST_PP_STRINGIZE(=X))
|
||||
|
||||
void print_macros()
|
||||
{
|
||||
|
||||
print_separator();
|
||||
|
||||
PRINT_MACRO(__GCCXML__);
|
||||
PRINT_MACRO(__WAVE__);
|
||||
PRINT_MACRO(__MWERKS__);
|
||||
PRINT_MACRO(__EDG__);
|
||||
PRINT_MACRO(_MSC_VER);
|
||||
PRINT_MACRO(__clang__);
|
||||
PRINT_MACRO(__DMC__);
|
||||
PRINT_MACRO(__BORLANDC__);
|
||||
PRINT_MACRO(__IBMC__);
|
||||
PRINT_MACRO(__IBMCPP__);
|
||||
PRINT_MACRO(__SUNPRO_CC);
|
||||
PRINT_MACRO(__CUDACC__);
|
||||
PRINT_MACRO(__PATHSCALE__);
|
||||
PRINT_MACRO(__CODEGEARC__);
|
||||
PRINT_MACRO(__HP_aCC);
|
||||
PRINT_MACRO(__SC__);
|
||||
PRINT_MACRO(__MRC__);
|
||||
PRINT_MACRO(__PGI);
|
||||
PRINT_MACRO(__INTEL_COMPILER);
|
||||
PRINT_MACRO(__GNUC__);
|
||||
PRINT_MACRO(__GXX_EXPERIMENTAL_CXX0X__);
|
||||
|
||||
print_separator();
|
||||
|
||||
PRINT_MACRO(__cplusplus);
|
||||
PRINT_MACRO(__STDC_VERSION__);
|
||||
PRINT_MACRO(__EDG_VERSION__);
|
||||
PRINT_MACRO(__INTELLISENSE__);
|
||||
PRINT_MACRO(__WAVE_HAS_VARIADICS__);
|
||||
|
||||
print_separator();
|
||||
|
||||
PRINT_MACRO(BOOST_PP_CONFIG_ERRORS);
|
||||
PRINT_MACRO(BOOST_PP_CONFIG_EXTENDED_LINE_INFO);
|
||||
PRINT_MACRO(BOOST_PP_CONFIG_FLAGS());
|
||||
PRINT_MACRO(BOOST_PP_VARIADICS);
|
||||
PRINT_MACRO(BOOST_PP_VARIADICS_MSVC);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
print_macros();
|
||||
|
||||
return 0;
|
||||
}
|
@ -26,6 +26,7 @@ BEGIN BOOST_PP_APPLY((BOOST_PP_EMPTY))() 0 == 0 END
|
||||
BEGIN BOOST_PP_EXPAND(MACRO ARGS) == 1 END
|
||||
|
||||
BEGIN BOOST_PP_IDENTITY(1)() == 1 END
|
||||
BEGIN BOOST_PP_IDENTITY_N(36,10)(0,1,2,3,4,5,6,7,8,9) == 36 END
|
||||
|
||||
BEGIN BOOST_PP_CAT(BOOST_PP_INTERCEPT, 2) 1 == 1 END
|
||||
|
||||
@ -36,7 +37,7 @@ BEGIN BOOST_PP_CAT(BOOST_PP_INTERCEPT, 2) 1 == 1 END
|
||||
#define OVMAC_3(x,y,z) BOOST_PP_ADD(BOOST_PP_MUL(x,y),z)
|
||||
#define OVMAC_4(x,y,z,a) BOOST_PP_ADD(BOOST_PP_MUL(x,y),BOOST_PP_MUL(a,z))
|
||||
|
||||
#if defined(BOOST_PP_VARIADICS_MSVC)
|
||||
#if BOOST_PP_VARIADICS_MSVC
|
||||
|
||||
#define OVTEST(...) BOOST_PP_CAT(BOOST_PP_OVERLOAD(OVMAC_,__VA_ARGS__)(__VA_ARGS__),BOOST_PP_EMPTY())
|
||||
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
#if defined(BOOST_PP_VARIADICS_MSVC) /* Testing the VC++ variadic version */
|
||||
#if BOOST_PP_VARIADICS_MSVC /* Testing the VC++ variadic version */
|
||||
|
||||
/* INCORRECT */
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
# include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
|
||||
#if BOOST_PP_VARIADICS && (BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()) && !defined(BOOST_PP_VARIADICS_MSVC)
|
||||
#if BOOST_PP_VARIADICS && (BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()) && !BOOST_PP_VARIADICS_MSVC
|
||||
|
||||
#define FUNC_GEN8(x,y) (1,2,3)
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
# include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
|
||||
#if BOOST_PP_VARIADICS && (BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()) && !defined(BOOST_PP_VARIADICS_MSVC)
|
||||
#if BOOST_PP_VARIADICS && (BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()) && !BOOST_PP_VARIADICS_MSVC
|
||||
|
||||
#define FUNC_GEN9(x,y,z) anything
|
||||
|
||||
|
81
test/seq.cxx
81
test/seq.cxx
@ -12,12 +12,14 @@
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <boost/preprocessor/arithmetic/add.hpp>
|
||||
# include <boost/preprocessor/arithmetic/mod.hpp>
|
||||
# include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/comparison/equal.hpp>
|
||||
# include <boost/preprocessor/comparison/less.hpp>
|
||||
# include <boost/preprocessor/control/iif.hpp>
|
||||
# include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
# include <boost/preprocessor/logical/not.hpp>
|
||||
# include <boost/preprocessor/seq.hpp>
|
||||
# include <boost/preprocessor/array/elem.hpp>
|
||||
# include <boost/preprocessor/array/size.hpp>
|
||||
@ -31,6 +33,50 @@
|
||||
|
||||
# define SEQ_NONE ()
|
||||
# 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)
|
||||
|
||||
# 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)
|
||||
|
||||
# define SEQ_256 SEQ_255(256)
|
||||
|
||||
# define SEQVAR (4,5,8,3,61)(1,0)(5,22,43)(2)(17,45,33)
|
||||
|
||||
# define REVERSAL(s, x, y) BOOST_PP_SUB(y, x)
|
||||
@ -40,6 +86,8 @@
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_SEQ_HEAD(SEQ_NONE)) == 1 END
|
||||
BEGIN BOOST_PP_SEQ_HEAD(SEQ) == 4 END
|
||||
BEGIN BOOST_PP_SEQ_HEAD(SEQ_255) == 1 END
|
||||
BEGIN BOOST_PP_SEQ_HEAD(SEQ_256) == 1 END
|
||||
|
||||
BEGIN BOOST_PP_SEQ_FOLD_LEFT(CAT_S, 1, SEQ_NONE) == 11 END
|
||||
BEGIN BOOST_PP_SEQ_FOLD_LEFT(SUB_S, 22, SEQ) == 10 END
|
||||
@ -51,12 +99,21 @@ BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REVERSE(SEQ_NONE))) == 1 E
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REVERSE(SEQ)) == 2514 END
|
||||
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REST_N(2, SEQ)) == 52 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REST_N(99, SEQ_100)) == 100 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REST_N(255, SEQ_256)) == 256 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_FIRST_N(1, SEQ_NONE))) == 1 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_FIRST_N(2, SEQ)) == 41 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(50,BOOST_PP_SEQ_FIRST_N(100, SEQ_100)) == 51 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(100,BOOST_PP_SEQ_FIRST_N(255, SEQ_255)) == 101 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(200,BOOST_PP_SEQ_FIRST_N(256, SEQ_256)) == 201 END
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_SEQ_ELEM(0, SEQ_NONE)) == 1 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(SEQ_NONE) == 1 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(2, SEQ) == 5 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(20, SEQ_255) == 21 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(254, SEQ_255) == 255 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(220, SEQ_256) == 221 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(255, SEQ_256) == 256 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(SEQ) == 4 END
|
||||
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_TRANSFORM(CAT_S, 13, SEQ_NONE)) == 131 END
|
||||
@ -83,29 +140,53 @@ BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_ARRAY_ELEM(0, BOOST_PP_SEQ_TO_ARRAY(SEQ_NONE)))
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_SEQ_TO_ARRAY(SEQ_NONE)) == 1 END
|
||||
|
||||
# define LESS_S(s, x, y) BOOST_PP_LESS(x, y)
|
||||
# define FILTER_MOD_S(s, data, elem) BOOST_PP_NOT(BOOST_PP_MOD(elem,data))
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_FILTER(LESS_S, 3, SEQ)) == 45 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(4,BOOST_PP_SEQ_FILTER(FILTER_MOD_S, 20, SEQ_100)) == 100 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(2,BOOST_PP_SEQ_FILTER(FILTER_MOD_S, 30, SEQ_100)) == 90 END
|
||||
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_INSERT(SEQ_NONE, 0, 7)) == 7 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_INSERT(SEQ, 0, 3)) == 34152 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_INSERT(SEQ, 2, 3)) == 41352 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_INSERT(SEQ, 4, 3)) == 41523 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_INSERT(SEQ_255, 0, 100)) == 256 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(255,BOOST_PP_SEQ_INSERT(SEQ_255, 0, 100)) == 255 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(0,BOOST_PP_SEQ_INSERT(SEQ_255, 0, 113)) == 113 END
|
||||
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_POP_BACK(SEQ)) == 415 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_POP_BACK(SEQ_256)) == 255 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(254,BOOST_PP_SEQ_POP_BACK(SEQ_256)) == 255 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(100,BOOST_PP_SEQ_POP_BACK(SEQ_256)) == 101 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_POP_FRONT(SEQ)) == 152 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_POP_FRONT(SEQ_256)) == 255 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(0,BOOST_PP_SEQ_POP_FRONT(SEQ_256)) == 2 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(254,BOOST_PP_SEQ_POP_FRONT(SEQ_256)) == 256 END
|
||||
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_PUSH_FRONT(SEQ_NONE, 145)) == 145 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_PUSH_FRONT(SEQ, 3)) == 34152 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_PUSH_FRONT(SEQ_255, 57)) == 256 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(0,BOOST_PP_SEQ_PUSH_FRONT(SEQ_255, 222)) == 222 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(255,BOOST_PP_SEQ_PUSH_FRONT(SEQ_255, 111)) == 255 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_PUSH_BACK(SEQ_NONE, 79)) == 79 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_PUSH_BACK(SEQ, 3)) == 41523 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_PUSH_BACK(SEQ_255, 199)) == 256 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(254,BOOST_PP_SEQ_PUSH_BACK(SEQ_255, 99)) == 255 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(255,BOOST_PP_SEQ_PUSH_BACK(SEQ_255, 99)) == 99 END
|
||||
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REMOVE(SEQ, 0)) == 152 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REMOVE(SEQ, 2)) == 412 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REMOVE(SEQ, 3)) == 415 END
|
||||
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_REMOVE(SEQ_255, 254)) == 254 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_REMOVE(SEQ_256, 255)) == 255 END
|
||||
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REPLACE(SEQ_NONE, 0, 22)) == 22 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REPLACE(SEQ, 0, 3)) == 3152 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REPLACE(SEQ, 1, 3)) == 4352 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_REPLACE(SEQ, 3, 3)) == 4153 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_REPLACE(SEQ_256, 255, 22)) == 256 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(233,BOOST_PP_SEQ_REPLACE(SEQ_256, 255, 22)) == 234 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(255,BOOST_PP_SEQ_REPLACE(SEQ_256, 255, 22)) == 22 END
|
||||
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_SUBSEQ(SEQ, 0, 4)) == 4152 END
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_SUBSEQ(SEQ, 0, 2)) == 41 END
|
||||
|
Reference in New Issue
Block a user