forked from boostorg/preprocessor
Revert "Merge branch 'master' into develop"
This reverts commit1422fce0db
, reversing changes made to9d2d1fffdf
.
This commit is contained in:
@ -19,22 +19,21 @@ project preprocessor_tests : requirements <warnings>on
|
||||
|
||||
test-suite preprocessor
|
||||
:
|
||||
[ compile arithmetic.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile array.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile comparison.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile control.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile debug.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile facilities.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile iteration.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile list.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile logical.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile punctuation.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile repetition.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile selection.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile seq.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile slot.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile tuple.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile variadic.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile arithmetic.cpp ]
|
||||
[ compile array.cpp ]
|
||||
[ compile comparison.cpp ]
|
||||
[ compile control.cpp ]
|
||||
[ compile debug.cpp ]
|
||||
[ compile facilities.cpp ]
|
||||
[ compile iteration.cpp ]
|
||||
[ compile list.cpp ]
|
||||
[ compile logical.cpp ]
|
||||
[ compile repetition.cpp ]
|
||||
[ compile selection.cpp ]
|
||||
[ compile seq.cpp ]
|
||||
[ compile slot.cpp ]
|
||||
[ compile tuple.cpp ]
|
||||
[ compile variadic.cpp ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_nvm
|
||||
@ -89,10 +88,6 @@ test-suite preprocessor_c
|
||||
: <toolset>gcc:<cflags>-std=c99
|
||||
: logical_c
|
||||
]
|
||||
[ compile punctuation.c
|
||||
: <toolset>gcc:<cflags>-std=c99
|
||||
: punctuation_c
|
||||
]
|
||||
[ compile selection.c
|
||||
: <toolset>gcc:<cflags>-std=c99
|
||||
: selection_c
|
||||
@ -178,40 +173,3 @@ test-suite preprocessor_c_nvm
|
||||
: tuple_c_nvm
|
||||
]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty
|
||||
:
|
||||
[ compile isempty.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile-fail isempty_variadic_standard_failure.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
[ compile-fail isempty_variadic_standard_failure2.cpp : <toolset>gcc:<cxxflags>-std=c++0x ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty_nvm
|
||||
:
|
||||
[ compile isempty.cpp : <define>BOOST_PP_VARIADICS=0 : isempty_nvm ]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty_c
|
||||
:
|
||||
[ compile isempty.c
|
||||
: <toolset>gcc:<cflags>-std=c99
|
||||
: isempty_c
|
||||
]
|
||||
[ compile-fail isempty_variadic_standard_failure.c
|
||||
: <toolset>gcc:<cflags>-std=c99
|
||||
: isempty_variadic_standard_failure_c
|
||||
]
|
||||
[ compile-fail isempty_variadic_standard_failure2.c
|
||||
: <toolset>gcc:<cflags>-std=c99
|
||||
: isempty_variadic_standard_failure2_c
|
||||
]
|
||||
;
|
||||
|
||||
test-suite preprocessor_isempty_c_nvm
|
||||
:
|
||||
[ compile isempty.c
|
||||
: <define>BOOST_PP_VARIADICS=0
|
||||
<toolset>gcc:<cflags>-std=c99
|
||||
: isempty_c_nvm
|
||||
]
|
||||
;
|
||||
|
@ -13,19 +13,14 @@
|
||||
#
|
||||
# include <boost/preprocessor/array.hpp>
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
# include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
# include <boost/preprocessor/list/at.hpp>
|
||||
# include <boost/preprocessor/list/size.hpp>
|
||||
# include <boost/preprocessor/seq/elem.hpp>
|
||||
# include <boost/preprocessor/seq/size.hpp>
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
# include <boost/preprocessor/tuple/size.hpp>
|
||||
# if BOOST_PP_VARIADICS
|
||||
# include <boost/preprocessor/variadic/size.hpp>
|
||||
# include <boost/preprocessor/variadic/elem.hpp>
|
||||
# endif
|
||||
|
||||
# define ARRAY_EMPTY (0, ())
|
||||
# define ARRAY (3, (0, 1, 2))
|
||||
# define ARRAY_LARGE (33, (0, 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))
|
||||
# define ARRAY_VERY_LARGE (64, (0, 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))
|
||||
@ -47,7 +42,6 @@ BEGIN BOOST_PP_ARRAY_SIZE(ARRAY_LARGE) == 33 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE((33, (0, 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 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(ARRAY_VERY_LARGE) == 64 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE((64, (0, 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 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(ARRAY_EMPTY) == 0 END
|
||||
|
||||
// enum
|
||||
|
||||
@ -63,7 +57,6 @@ BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_ARRAY_ENUM((5, (0, 1, 2, 3, 4)))) == 5 END
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_ARRAY_ENUM(ARRAY_LARGE)) == 33 END
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_ARRAY_ENUM(ARRAY_VERY_LARGE)) == 64 END
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_ARRAY_ENUM((64, (0, 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 END
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_ARRAY_ENUM(ARRAY_EMPTY)) == 1 END
|
||||
|
||||
# endif
|
||||
|
||||
@ -73,7 +66,6 @@ BEGIN BOOST_PP_LIST_AT(BOOST_PP_ARRAY_TO_LIST(ARRAY), 1) == 1 END
|
||||
BEGIN BOOST_PP_LIST_AT(BOOST_PP_ARRAY_TO_LIST((5, (0, 1, 2, 3, 4))), 4) == 4 END
|
||||
BEGIN BOOST_PP_LIST_AT(BOOST_PP_ARRAY_TO_LIST((33, (0, 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))), 26) == 26 END
|
||||
BEGIN BOOST_PP_LIST_AT(BOOST_PP_ARRAY_TO_LIST(ARRAY_VERY_LARGE), 60) == 60 END
|
||||
BEGIN BOOST_PP_LIST_SIZE(BOOST_PP_ARRAY_TO_LIST(ARRAY_EMPTY)) == 0 END
|
||||
|
||||
// to_seq
|
||||
|
||||
@ -112,9 +104,6 @@ BEGIN BOOST_PP_ARRAY_ELEM(22, BOOST_PP_ARRAY_INSERT(ARRAY_LARGE,22,1000)) == 100
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(26, BOOST_PP_ARRAY_INSERT(ARRAY_LARGE,22,1000)) == 25 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_INSERT(ARRAY_LARGE,22,1000)) == 34 END
|
||||
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(0, BOOST_PP_ARRAY_INSERT(ARRAY_EMPTY,0,25)) == 25 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_INSERT(ARRAY_EMPTY,0,1000)) == 1 END
|
||||
|
||||
// pop_back
|
||||
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_POP_BACK(ARRAY)) == 2 END
|
||||
@ -135,19 +124,15 @@ BEGIN BOOST_PP_ARRAY_ELEM(55, BOOST_PP_ARRAY_POP_FRONT(ARRAY_VERY_LARGE)) == 56
|
||||
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_PUSH_BACK(ARRAY, 3)) == 4 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_PUSH_BACK(ARRAY_LARGE, 33)) == 34 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_PUSH_BACK(ARRAY_EMPTY, 10)) == 1 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(0, BOOST_PP_ARRAY_PUSH_BACK(ARRAY, 3)) == 0 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(33, BOOST_PP_ARRAY_PUSH_BACK(ARRAY_LARGE, 33)) == 33 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(0, BOOST_PP_ARRAY_PUSH_BACK(ARRAY_EMPTY, 136)) == 136 END
|
||||
|
||||
// push_front
|
||||
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_PUSH_FRONT(ARRAY, 555)) == 4 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_PUSH_FRONT(ARRAY_LARGE, 666)) == 34 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_PUSH_FRONT(ARRAY_EMPTY, 10)) == 1 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(0, BOOST_PP_ARRAY_PUSH_FRONT(ARRAY, 555)) == 555 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(33, BOOST_PP_ARRAY_PUSH_FRONT(ARRAY_LARGE, 33)) == 32 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(0, BOOST_PP_ARRAY_PUSH_FRONT(ARRAY_EMPTY, 136)) == 136 END
|
||||
|
||||
// remove
|
||||
|
||||
@ -172,4 +157,3 @@ BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_REVERSE(ARRAY_VERY_LARGE)) == 64 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(0, BOOST_PP_ARRAY_REVERSE(ARRAY)) == 2 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(29, BOOST_PP_ARRAY_REVERSE(ARRAY_LARGE)) == 3 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(38, BOOST_PP_ARRAY_REVERSE(ARRAY_VERY_LARGE)) == 25 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_ARRAY_REVERSE(ARRAY_EMPTY)) == 0 END
|
||||
|
@ -1,12 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/isempty.cxx>
|
@ -1,12 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/isempty.cxx>
|
145
test/isempty.cxx
145
test/isempty.cxx
@ -1,145 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <boost/preprocessor/config/config.hpp>
|
||||
#
|
||||
#if (BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()) || (BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC())
|
||||
|
||||
# include <boost/preprocessor/facilities/empty.hpp>
|
||||
# include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
|
||||
#define DATA
|
||||
#define OBJECT OBJECT2
|
||||
#define OBJECT2
|
||||
#define FUNC(x) FUNC2(x)
|
||||
#define FUNC2(x)
|
||||
#define FUNC_GEN() ()
|
||||
#define FUNC_GEN2(x) ()
|
||||
#define FUNC_GEN3() (&)
|
||||
#define FUNC_GEN4(x) (y)
|
||||
#define FUNC_GEN5() (y,z)
|
||||
#define FUNC_GEN6() anything
|
||||
#define FUNC_GEN7(x) anything
|
||||
#define FUNC_GEN8(x,y) (1,2,3)
|
||||
#define FUNC_GEN9(x,y,z) anything
|
||||
#define FUNC_GEN10(x) (y) data
|
||||
#define NAME &name
|
||||
#define ATUPLE (atuple)
|
||||
#define ATUPLE_PLUS (atuple) data
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
#if defined(BOOST_PP_VARIADICS_MSVC) /* Testing the VC++ variadic version */
|
||||
|
||||
/* INCORRECT */
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN2) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN3) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN4) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN5) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN8) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN10) == 1 END
|
||||
|
||||
/* CORRECT */
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN9) == 0 END
|
||||
|
||||
#else /* Testing the non-VC++ variadic version */
|
||||
|
||||
/* CORRECT */
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN2) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN3) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN4) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN5) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN10) == 0 END
|
||||
|
||||
/* COMPILER ERROR */
|
||||
|
||||
// BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN8) == 0 END
|
||||
// BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN9) == 0 END
|
||||
|
||||
#endif
|
||||
|
||||
/* Testing the variadic version */
|
||||
|
||||
/* CORRECT */
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(DATA BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(x BOOST_PP_EMPTY()) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(OBJECT BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC(z) BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN6) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN7) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(NAME) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(ATUPLE) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(ATUPLE_PLUS) == 0 END
|
||||
|
||||
#else
|
||||
|
||||
#if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC() /* Testing the VC++ non-variadic version */
|
||||
|
||||
/* INCORRECT */
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN2) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN3) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN4) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN5) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN8) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(ATUPLE) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN10) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(ATUPLE_PLUS) == 1 END
|
||||
|
||||
/* CORRECT */
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(NAME) == 0 END
|
||||
|
||||
#else /* Testing the non-VC++ non-variadic version */
|
||||
|
||||
/* CORRECT */
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN2) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN3) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN4) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN5) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN8) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN10) == 0 END
|
||||
|
||||
/* UNDEFINED BEHAVIOR */
|
||||
|
||||
// BEGIN BOOST_PP_IS_EMPTY(ATUPLE) == 0 END
|
||||
// BEGIN BOOST_PP_IS_EMPTY(ATUPLE_PLUS) == 1 END
|
||||
// BEGIN BOOST_PP_IS_EMPTY(NAME) == 0 END
|
||||
|
||||
#endif
|
||||
|
||||
/* Testing the non-variadic version */
|
||||
|
||||
/* CORRECT */
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(DATA BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(x BOOST_PP_EMPTY()) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(OBJECT BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC(z) BOOST_PP_EMPTY()) == 1 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN6) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN7) == 0 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN9) == 0 END
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,12 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/isempty_variadic_standard_failure.cxx>
|
@ -1,12 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/isempty_variadic_standard_failure.cxx>
|
@ -1,25 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <boost/preprocessor/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)
|
||||
|
||||
#define FUNC_GEN8(x,y) (1,2,3)
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN8) == 0 END
|
||||
|
||||
#else
|
||||
|
||||
BEGIN 1 == 0 END
|
||||
|
||||
#endif
|
@ -1,12 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/isempty_variadic_standard_failure2.cxx>
|
@ -1,12 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/isempty_variadic_standard_failure2.cxx>
|
@ -1,25 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <boost/preprocessor/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)
|
||||
|
||||
#define FUNC_GEN9(x,y,z) anything
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(FUNC_GEN9) == 0 END
|
||||
|
||||
#else
|
||||
|
||||
BEGIN 1 == 0 END
|
||||
|
||||
#endif
|
@ -16,27 +16,17 @@
|
||||
# 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/list.hpp>
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
# include <boost/preprocessor/tuple/size.hpp>
|
||||
# include <boost/preprocessor/array/elem.hpp>
|
||||
# include <boost/preprocessor/array/size.hpp>
|
||||
# include <boost/preprocessor/seq/elem.hpp>
|
||||
# include <boost/preprocessor/seq/size.hpp>
|
||||
# include <boost/preprocessor/variadic/elem.hpp>
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
|
||||
# define LISTNIL BOOST_PP_NIL
|
||||
# define LIST (4, (1, (5, (2, BOOST_PP_NIL))))
|
||||
|
||||
# define REVERSAL(d, x, y) BOOST_PP_SUB_D(d, y, x)
|
||||
# define F1(r, state, x) + x + state
|
||||
# define FI2(r, state, i, x) BOOST_PP_IIF(BOOST_PP_EQUAL(i,1),+ x + x + state,+ x + state)
|
||||
# define F2(r, x) + BOOST_PP_TUPLE_ELEM(2, 0, x) + 2 - BOOST_PP_TUPLE_ELEM(2, 1, x)
|
||||
# define L1 (0, (x, BOOST_PP_NIL))
|
||||
# define L2 (a, (1, (b, (2, BOOST_PP_NIL))))
|
||||
# define L3 (c, (3, (d, BOOST_PP_NIL)))
|
||||
# define LL (L1, (L2, (L3, BOOST_PP_NIL)))
|
||||
|
||||
BEGIN BOOST_PP_LIST_FIRST(LIST) == 4 END
|
||||
BEGIN BOOST_PP_LIST_IS_CONS(LIST) == 1 END
|
||||
@ -51,28 +41,22 @@ BEGIN BOOST_PP_VARIADIC_ELEM(2,BOOST_PP_LIST_ENUM(LIST)) == 5 END
|
||||
#endif
|
||||
|
||||
BEGIN BOOST_PP_LIST_FOLD_LEFT(BOOST_PP_SUB_D, 22, LIST) == 10 END
|
||||
BEGIN BOOST_PP_LIST_FOLD_LEFT(BOOST_PP_SUB_D, 22, LISTNIL) == 22 END
|
||||
BEGIN BOOST_PP_LIST_FOLD_RIGHT(BOOST_PP_ADD_D, 0, LIST) == 12 END
|
||||
BEGIN BOOST_PP_LIST_FOLD_RIGHT(BOOST_PP_ADD_D, 0, LISTNIL) == 0 END
|
||||
BEGIN BOOST_PP_LIST_FOLD_RIGHT(REVERSAL, 0, LIST) == 4 END
|
||||
|
||||
BEGIN BOOST_PP_LIST_CAT(BOOST_PP_LIST_REVERSE(LIST)) == 2514 END
|
||||
BEGIN BOOST_PP_LIST_IS_NIL(BOOST_PP_LIST_REVERSE(LISTNIL)) == 1 END
|
||||
|
||||
BEGIN BOOST_PP_LIST_CAT(BOOST_PP_LIST_REST_N(2, LIST)) == 52 END
|
||||
BEGIN BOOST_PP_LIST_IS_NIL(BOOST_PP_LIST_REST_N(0, LISTNIL)) == 1 END
|
||||
BEGIN BOOST_PP_LIST_CAT(BOOST_PP_LIST_FIRST_N(2, LIST)) == 41 END
|
||||
|
||||
BEGIN BOOST_PP_LIST_AT(LIST, 2) == 5 END
|
||||
BEGIN BOOST_PP_LIST_SIZE(LIST) == 4 END
|
||||
BEGIN BOOST_PP_LIST_SIZE(LISTNIL) == 0 END
|
||||
|
||||
BEGIN BOOST_PP_LIST_CAT(BOOST_PP_LIST_TRANSFORM(BOOST_PP_ADD_D, 2, LIST)) == 6374 END
|
||||
BEGIN BOOST_PP_LIST_IS_NIL(BOOST_PP_LIST_TRANSFORM(BOOST_PP_ADD_D, 2, LISTNIL)) == 1 END
|
||||
BEGIN BOOST_PP_LIST_CAT(BOOST_PP_LIST_APPEND(BOOST_PP_LIST_REST(LIST), LIST)) == 1524152 END
|
||||
BEGIN BOOST_PP_LIST_CAT(BOOST_PP_LIST_APPEND(LIST,LISTNIL)) == 4152 END
|
||||
BEGIN BOOST_PP_LIST_CAT(BOOST_PP_LIST_APPEND(LISTNIL,LIST)) == 4152 END
|
||||
BEGIN BOOST_PP_LIST_IS_NIL(BOOST_PP_LIST_APPEND(LISTNIL,LISTNIL)) == 1 END
|
||||
|
||||
# define F1(r, state, x) + x + state
|
||||
# define FI2(r, state, i, x) BOOST_PP_IIF(BOOST_PP_EQUAL(i,1),+ x + x + state,+ x + state)
|
||||
|
||||
BEGIN BOOST_PP_LIST_FOR_EACH(F1, 1, LIST) == 16 END
|
||||
BEGIN BOOST_PP_LIST_FOR_EACH_I(FI2, 1, LIST) == 17 END
|
||||
@ -80,12 +64,17 @@ BEGIN BOOST_PP_LIST_FOR_EACH_I(FI2, 1, LIST) == 17 END
|
||||
BEGIN BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_LIST_TO_TUPLE(LIST)) == 2 END
|
||||
|
||||
BEGIN BOOST_PP_LIST_CAT(BOOST_PP_LIST_FILTER(BOOST_PP_LESS_D, 3, LIST)) == 45 END
|
||||
BEGIN BOOST_PP_LIST_IS_NIL(BOOST_PP_LIST_FILTER(BOOST_PP_LESS_D, 3, LISTNIL)) == 1 END
|
||||
|
||||
# define F2(r, x) + BOOST_PP_TUPLE_ELEM(2, 0, x) + 2 - BOOST_PP_TUPLE_ELEM(2, 1, x)
|
||||
BEGIN BOOST_PP_LIST_FOR_EACH_PRODUCT(F2, 2, ( (1, (0, BOOST_PP_NIL)), (2, (3, BOOST_PP_NIL)) )) == 0 END
|
||||
|
||||
# define L1 (0, (x, BOOST_PP_NIL))
|
||||
# define L2 (a, (1, (b, (2, BOOST_PP_NIL))))
|
||||
# define L3 (c, (3, (d, BOOST_PP_NIL)))
|
||||
|
||||
# define LL (L1, (L2, (L3, BOOST_PP_NIL)))
|
||||
|
||||
BEGIN BOOST_PP_LIST_CAT(BOOST_PP_LIST_FOLD_LEFT(BOOST_PP_LIST_APPEND_D, BOOST_PP_NIL, LL)) == 0x0a1b2c3d END
|
||||
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(2, BOOST_PP_LIST_TO_ARRAY(LIST)) == 5 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_LIST_TO_ARRAY(LISTNIL)) == 0 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(3, BOOST_PP_LIST_TO_SEQ(LIST)) == 2 END
|
||||
|
@ -1,14 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* Revised by Edward Diener (2011) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/punctuation.cxx>
|
@ -1,14 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) 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)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* Revised by Edward Diener (2011) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <libs/preprocessor/test/punctuation.cxx>
|
@ -1,54 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * 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. */
|
||||
#
|
||||
# if BOOST_PP_VARIADICS
|
||||
# include <boost/preprocessor/punctuation.hpp>
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
|
||||
# define A_TUPLE (*,#,zz)
|
||||
# define A_TUPLE2 (*,#,(zz,44,(e7)))
|
||||
# define A_TUPLE_PLUS (mmf,34,^^,!) 456
|
||||
# define PLUS_ATUPLE yyt (j,ii%)
|
||||
# define JDATA ggh
|
||||
# define NOT_TUPLE y6()
|
||||
# define NOT_TUPLE2 &(kkkgg,(e))
|
||||
# define A_SEQ (r)($)(#)
|
||||
# define AN_ARRAY (4,(5,7,f,x))
|
||||
# define A_LIST (e,(g,(&,BOOST_PP_NIL)))
|
||||
# define DATA (5 + 3) * 4
|
||||
# define DATA2 4 * (5 + 3)
|
||||
# define DATA3 4 * (5 + 3) * (2 + 1)
|
||||
# define DATA4 (5 + 3) * (2 + 1) * 4
|
||||
|
||||
|
||||
// is_begin_parens
|
||||
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS() == 0 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS(A_TUPLE) == 1 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS(A_TUPLE2) == 1 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS(A_TUPLE_PLUS) == 1 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS(PLUS_ATUPLE) == 0 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS(JDATA) == 0 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS(NOT_TUPLE) == 0 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS(NOT_TUPLE2) == 0 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS(A_SEQ) == 1 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS(AN_ARRAY) == 1 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS(A_LIST) == 1 END
|
||||
BEGIN BOOST_PP_IS_BEGIN_PARENS((y)2(x)) == 1 END
|
||||
|
||||
// remove_parens
|
||||
|
||||
BEGIN BOOST_PP_REMOVE_PARENS(DATA) == 17 END
|
||||
BEGIN BOOST_PP_REMOVE_PARENS(DATA2)== 32 END
|
||||
BEGIN BOOST_PP_REMOVE_PARENS(DATA3)== 96 END
|
||||
BEGIN BOOST_PP_REMOVE_PARENS(DATA4)== 41 END
|
||||
|
||||
#endif
|
18
test/seq.cxx
18
test/seq.cxx
@ -16,18 +16,13 @@
|
||||
# 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/seq.hpp>
|
||||
# include <boost/preprocessor/array/elem.hpp>
|
||||
# include <boost/preprocessor/array/size.hpp>
|
||||
# include <boost/preprocessor/tuple/elem.hpp>
|
||||
# include <boost/preprocessor/tuple/size.hpp>
|
||||
# include <boost/preprocessor/list/at.hpp>
|
||||
# include <boost/preprocessor/list/size.hpp>
|
||||
# include <boost/preprocessor/variadic/elem.hpp>
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
|
||||
# define SEQ_NONE ()
|
||||
# define SEQ (4)(1)(5)(2)
|
||||
# define SEQVAR (4,5,8,3,61)(1,0)(5,22,43)(2)(17,45,33)
|
||||
|
||||
@ -58,19 +53,8 @@ BEGIN BOOST_PP_SEQ_FOR_EACH(F1, 1, SEQ) == 16 END
|
||||
BEGIN BOOST_PP_SEQ_FOR_EACH_I(FI2, 1, SEQ) == 21 END
|
||||
|
||||
BEGIN BOOST_PP_TUPLE_ELEM(4, 3, BOOST_PP_SEQ_TO_TUPLE(SEQ)) == 2 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1, 0, BOOST_PP_SEQ_TO_TUPLE(SEQ_NONE))) == 1 END
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
BEGIN BOOST_PP_TUPLE_SIZE(BOOST_PP_SEQ_TO_TUPLE(SEQ_NONE)) == 1 END
|
||||
|
||||
#endif
|
||||
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(3, BOOST_PP_SEQ_TO_ARRAY(SEQ)) == 2 END
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_ARRAY_ELEM(0, BOOST_PP_SEQ_TO_ARRAY(SEQ_NONE))) == 1 END
|
||||
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)
|
||||
BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_FILTER(LESS_S, 3, SEQ)) == 45 END
|
||||
|
||||
@ -114,8 +98,6 @@ BEGIN BOOST_PP_SEQ_CAT(BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_FOLD_LEFT(SEQ_APPEND, (~),
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_FOLD_LEFT(SEQ_APPEND, (~), LL))) == 9 END
|
||||
|
||||
BEGIN BOOST_PP_LIST_AT(BOOST_PP_SEQ_TO_LIST(SEQ), 2) == 5 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_LIST_AT(BOOST_PP_SEQ_TO_LIST(SEQ_NONE),0)) == 1 END
|
||||
BEGIN BOOST_PP_LIST_SIZE(BOOST_PP_SEQ_TO_LIST(SEQ_NONE)) == 1 END
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
|
@ -7,29 +7,21 @@
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* Revised by Edward Diener (2011,2014) */
|
||||
# /* Revised by Edward Diener (2011) */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/control/if.hpp>
|
||||
# include <boost/preprocessor/tuple.hpp>
|
||||
# include <boost/preprocessor/array/elem.hpp>
|
||||
# include <boost/preprocessor/array/size.hpp>
|
||||
# include <boost/preprocessor/list/at.hpp>
|
||||
# include <boost/preprocessor/list/size.hpp>
|
||||
# include <boost/preprocessor/seq/elem.hpp>
|
||||
# include <boost/preprocessor/seq/size.hpp>
|
||||
# include <boost/preprocessor/facilities/is_empty.hpp>
|
||||
# if BOOST_PP_VARIADICS
|
||||
# include <boost/preprocessor/variadic/size.hpp>
|
||||
# include <boost/preprocessor/variadic/elem.hpp>
|
||||
# endif
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
# include <libs/preprocessor/test/tuple_elem_bug_test.cxx>
|
||||
|
||||
# define TUPLE (0, 1, 2, 3, 4, 5)
|
||||
# define TUPLE_NONE ()
|
||||
# define TUPLE_LARGE (0, 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)
|
||||
# define TUPLE_VERY_LARGE (0, 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)
|
||||
# define T2 (+3, /2, +6)
|
||||
@ -52,7 +44,6 @@
|
||||
|
||||
// elem
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_TUPLE_ELEM(1, 0, TUPLE_NONE)) == 1 END
|
||||
BEGIN BOOST_PP_TUPLE_ELEM(6, 3, TUPLE) == 3 END
|
||||
BEGIN BOOST_PP_TUPLE_ELEM(6, 5, TUPLE) == 5 END
|
||||
BEGIN BOOST_PP_TUPLE_ELEM(33, 15, TUPLE_LARGE) == 15 END
|
||||
@ -81,30 +72,23 @@ BEGIN TEST_EAT_VERY_LARGE == 8 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(3,BOOST_PP_TUPLE_TO_ARRAY(6,TUPLE)) == 3 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(29,BOOST_PP_TUPLE_TO_ARRAY(33,TUPLE_LARGE)) == 29 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(61,BOOST_PP_TUPLE_TO_ARRAY(64,TUPLE_VERY_LARGE)) == 61 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_ARRAY_ELEM(0,BOOST_PP_TUPLE_TO_ARRAY(1,TUPLE_NONE))) == 1 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_TUPLE_TO_ARRAY(1,TUPLE_NONE)) == 1 END
|
||||
|
||||
// to_list
|
||||
|
||||
BEGIN BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(6,TUPLE), 2) == 2 END
|
||||
BEGIN BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(33,TUPLE_LARGE), 19) == 19 END
|
||||
BEGIN BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(64,TUPLE_VERY_LARGE), 62) == 62 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(1,TUPLE_NONE), 0)) == 1 END
|
||||
BEGIN BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_TO_LIST(1,TUPLE_NONE)) == 1 END
|
||||
|
||||
// to_seq
|
||||
|
||||
BEGIN BOOST_PP_SEQ_ELEM(4,BOOST_PP_TUPLE_TO_SEQ(6,TUPLE)) == 4 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(31,BOOST_PP_TUPLE_TO_SEQ(33,TUPLE_LARGE)) == 31 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(55,BOOST_PP_TUPLE_TO_SEQ(64,TUPLE_VERY_LARGE)) == 55 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_SEQ_ELEM(0,BOOST_PP_TUPLE_TO_SEQ(1,TUPLE_NONE))) == 1 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_TO_SEQ(1,TUPLE_NONE)) == 1 END
|
||||
|
||||
#if BOOST_PP_VARIADICS
|
||||
|
||||
// elem
|
||||
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_TUPLE_ELEM(0, TUPLE_NONE)) == 1 END
|
||||
BEGIN BOOST_PP_TUPLE_ELEM(3, TUPLE) == 3 END
|
||||
BEGIN BOOST_PP_TUPLE_ELEM(5, TUPLE) == 5 END
|
||||
BEGIN BOOST_PP_TUPLE_ELEM(15, TUPLE_LARGE) == 15 END
|
||||
@ -174,7 +158,7 @@ BEGIN BOOST_PP_TUPLE_ELEM(33, BOOST_PP_TUPLE_PUSH_FRONT(TUPLE_LARGE, 33)) == 32
|
||||
|
||||
// rem
|
||||
|
||||
#if BOOST_PP_VARIADICS_MSVC && _MSC_VER <= 1400
|
||||
#if BOOST_PP_VARIADICS_MSVC && _MSC_VER == 1400
|
||||
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM(6)(0, 1, 2, 3, 4, 5)) == 6 END
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM(33)(0, 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 END
|
||||
@ -182,12 +166,6 @@ BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM(64)(0, 1, 2, 3, 4, 5, 6, 7, 8, 9
|
||||
|
||||
#else
|
||||
|
||||
#if BOOST_PP_VARIADICS_MSVC
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_TUPLE_REM_CAT() TUPLE_NONE) == 1 END
|
||||
#else
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_TUPLE_REM() TUPLE_NONE) == 1 END
|
||||
#endif
|
||||
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM()(0, 1, 2, 3, 4, 5)) == 6 END
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM()(0, 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 END
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM()(0, 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 END
|
||||
@ -196,7 +174,6 @@ BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM()(0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
||||
|
||||
// rem_ctor
|
||||
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM_CTOR(TUPLE_NONE)) == 1 END
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM_CTOR(TUPLE)) == 6 END
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM_CTOR(TUPLE_LARGE)) == 33 END
|
||||
BEGIN BOOST_PP_VARIADIC_SIZE(BOOST_PP_TUPLE_REM_CTOR(TUPLE_VERY_LARGE)) == 64 END
|
||||
@ -229,23 +206,17 @@ BEGIN BOOST_PP_TUPLE_SIZE(TUPLE_VERY_LARGE) == 64 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(3,BOOST_PP_TUPLE_TO_ARRAY(TUPLE)) == 3 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(29,BOOST_PP_TUPLE_TO_ARRAY(TUPLE_LARGE)) == 29 END
|
||||
BEGIN BOOST_PP_ARRAY_ELEM(61,BOOST_PP_TUPLE_TO_ARRAY(TUPLE_VERY_LARGE)) == 61 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_ARRAY_ELEM(0,BOOST_PP_TUPLE_TO_ARRAY(TUPLE_NONE))) == 1 END
|
||||
BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_TUPLE_TO_ARRAY(TUPLE_NONE)) == 1 END
|
||||
|
||||
// to_tuple
|
||||
|
||||
BEGIN BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(TUPLE), 2) == 2 END
|
||||
BEGIN BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(TUPLE_LARGE), 19) == 19 END
|
||||
BEGIN BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(TUPLE_VERY_LARGE), 62) == 62 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(TUPLE_NONE), 0)) == 1 END
|
||||
BEGIN BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_TO_LIST(TUPLE_NONE)) == 1 END
|
||||
|
||||
// to_seq
|
||||
|
||||
BEGIN BOOST_PP_SEQ_ELEM(4,BOOST_PP_TUPLE_TO_SEQ(TUPLE)) == 4 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(31,BOOST_PP_TUPLE_TO_SEQ(TUPLE_LARGE)) == 31 END
|
||||
BEGIN BOOST_PP_SEQ_ELEM(55,BOOST_PP_TUPLE_TO_SEQ(TUPLE_VERY_LARGE)) == 55 END
|
||||
BEGIN BOOST_PP_IS_EMPTY(BOOST_PP_SEQ_ELEM(0,BOOST_PP_TUPLE_TO_SEQ(TUPLE_NONE))) == 1 END
|
||||
BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_TO_SEQ(TUPLE_NONE)) == 1 END
|
||||
|
||||
#endif
|
||||
|
@ -1,38 +0,0 @@
|
||||
# /* **************************************************************************
|
||||
# * *
|
||||
# * (C) Copyright Edward Diener 2014.
|
||||
# * Distributed under the Boost Software License, Version 1.0. (See
|
||||
# * accompanying file LICENSE_1_0.txt or copy at
|
||||
# * http://www.boost.org/LICENSE_1_0.txt)
|
||||
# * *
|
||||
# ************************************************************************** */
|
||||
#
|
||||
# /* See http://www.boost.org for most recent version. */
|
||||
#
|
||||
# include <boost/preprocessor/cat.hpp>
|
||||
# include <boost/preprocessor/control/if.hpp>
|
||||
# include <boost/preprocessor/tuple.hpp>
|
||||
# include <libs/preprocessor/test/test.h>
|
||||
|
||||
#define TN_GEN_ONE(p) (1)
|
||||
#define TN_GEN_ZERO(p) (0)
|
||||
#define TN_TEST_ONE_MORE(parameter,ens) \
|
||||
BOOST_PP_IF \
|
||||
( \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(1,0,ens),0), \
|
||||
TN_GEN_ONE, \
|
||||
TN_GEN_ZERO \
|
||||
) \
|
||||
(parameter) \
|
||||
/**/
|
||||
#define TN_TEST_ONE(parameter,ens) \
|
||||
BOOST_PP_TUPLE_ELEM \
|
||||
( \
|
||||
1, \
|
||||
0, \
|
||||
TN_TEST_ONE_MORE(parameter,ens) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
BEGIN TN_TEST_ONE(A,(1)) == 1 END
|
||||
BEGIN TN_TEST_ONE(A,()) == 0 END
|
Reference in New Issue
Block a user