|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73083 - in branches/pplib/v2: boost/preprocessor/debug libs/preprocessor/test
From: eldiener_at_[hidden]
Date: 2011-07-13 18:31:34
Author: eldiener
Date: 2011-07-13 18:31:33 EDT (Wed, 13 Jul 2011)
New Revision: 73083
URL: http://svn.boost.org/trac/boost/changeset/73083
Log:
Updated ASSERT_IS_SEQ now works properly.
Text files modified:
branches/pplib/v2/boost/preprocessor/debug/assert_is_seq.hpp | 71 +++++++++++++++------------------------
branches/pplib/v2/libs/preprocessor/test/debug.cxx | 6 +-
2 files changed, 30 insertions(+), 47 deletions(-)
Modified: branches/pplib/v2/boost/preprocessor/debug/assert_is_seq.hpp
==============================================================================
--- branches/pplib/v2/boost/preprocessor/debug/assert_is_seq.hpp (original)
+++ branches/pplib/v2/boost/preprocessor/debug/assert_is_seq.hpp 2011-07-13 18:31:33 EDT (Wed, 13 Jul 2011)
@@ -31,6 +31,10 @@
# else
#
# define BOOST_PP_ASSERT_IS_SEQ(x) \
+ BOOST_PP_ASSERT \
+ ( \
+ BOOST_PP_IS_TUPLE_BEGIN(x) \
+ ) \
BOOST_PP_IS_SEQ_DETAIL_GEN_EMPTY \
( \
BOOST_PP_WHILE \
@@ -49,13 +53,7 @@
# define BOOST_PP_IS_SEQ_DETAIL_GEN_EMPTY_I(x)
#
# define BOOST_PP_IS_SEQ_DETAIL_PRED(d,state) \
- BOOST_PP_IIF \
- ( \
- BOOST_PP_IS_TUPLE_BEGIN(state), \
- BOOST_PP_IS_SEQ_DETAIL_GEN_ONE, \
- BOOST_PP_IS_SEQ_DETAIL_CHECK_NIL \
- ) \
- (state) \
+ BOOST_PP_IS_TUPLE_BEGIN(state) \
/**/
#
# define BOOST_PP_IS_SEQ_DETAIL_OP(d,state) \
@@ -68,69 +66,54 @@
(state) \
/**/
#
+# define BOOST_PP_IS_SEQ_DETAIL_ASSERT_SIZE(...) \
+ BOOST_PP_ASSERT \
+ ( \
+ BOOST_PP_EQUAL \
+ ( \
+ BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), \
+ 1 \
+ ) \
+ ) \
+ 1 \
+/**/
+#
# define BOOST_PP_IS_SEQ_DETAIL_ASSERT_FIRST_TUPLE_SIZE(x) \
- BOOST_PP_IS_SEQ_DETAIL_EMPTY \
+ BOOST_PP_IS_SEQ_DETAIL_EMPTY_E \
( \
BOOST_PP_IS_SEQ_DETAIL_ASSERT_SIZE x \
) \
/**/
-#
# define BOOST_PP_IS_SEQ_DETAIL_GET_AFTER_FIRST_TUPLE(x) \
BOOST_PP_IS_SEQ_DETAIL_EMPTY x \
/**/
#
# define BOOST_PP_IS_SEQ_DETAIL_GEN_NOT_TUPLE(x) \
- BOOST_PP_IS_SEQ_DETAIL_GEN_NIL \
-/**/
-#
-# define BOOST_PP_IS_SEQ_DETAIL_IS_AFTER_FIRST_TUPLE(x) \
- BOOST_PP_IS_SEQ_DETAIL_ASSERT_FIRST_TUPLE_SIZE(x) \
- BOOST_PP_NOT \
+ BOOST_PP_ASSERT \
( \
BOOST_PP_IS_EMPTY \
( \
BOOST_PP_IS_SEQ_DETAIL_EMPTY x \
) \
) \
+ BOOST_PP_IS_SEQ_DETAIL_NIL \
/**/
#
-# define BOOST_PP_IS_SEQ_DETAIL_ASSERT_SIZE(...) \
- BOOST_PP_ASSERT \
+# define BOOST_PP_IS_SEQ_DETAIL_IS_AFTER_FIRST_TUPLE(x) \
+ BOOST_PP_IS_SEQ_DETAIL_ASSERT_FIRST_TUPLE_SIZE(x) \
+ BOOST_PP_IS_TUPLE_BEGIN \
( \
- BOOST_PP_EQUAL \
- ( \
- BOOST_PP_VARIADIC_SIZE(__VA_ARGS__), \
- 1 \
- ) \
+ BOOST_PP_IS_SEQ_DETAIL_EMPTY x \
) \
/**/
#
# define BOOST_PP_IS_SEQ_DETAIL_EMPTY(...)
#
-# define BOOST_PP_IS_SEQ_DETAIL_GEN_ONE(x) \
- 1 \
-/**/
-#
-# define BOOST_PP_IS_SEQ_DETAIL_CHECK_NIL(x) \
- BOOST_PP_ASSERT \
- ( \
- BOOST_PP_IS_SEQ_DETAIL_NIL(x) \
- ) \
- 0 \
-/**/
-#
-# define BOOST_PP_IS_SEQ_DETAIL_NIL(x) \
- BOOST_PP_IS_EMPTY \
- ( \
- BOOST_PP_CAT \
- ( \
- BOOST_PP_IS_SEQ_DETAIL_NIL_HELPER_, \
- x \
- ) \
- ) \
+# define BOOST_PP_IS_SEQ_DETAIL_EMPTY_E(...) \
+ BOOST_PP_IS_SEQ_DETAIL_EMPTY_1(__VA_ARGS__) \
/**/
#
-# define BOOST_PP_IS_SEQ_DETAIL_NIL_HELPER_BOOST_PP_IS_SEQ_DETAIL_GEN_NIL
+# define BOOST_PP_IS_SEQ_DETAIL_EMPTY_1(...)
#
# endif /* NDEBUG */
# endif /* BOOST_PP_VARIADICS */
Modified: branches/pplib/v2/libs/preprocessor/test/debug.cxx
==============================================================================
--- branches/pplib/v2/libs/preprocessor/test/debug.cxx (original)
+++ branches/pplib/v2/libs/preprocessor/test/debug.cxx 2011-07-13 18:31:33 EDT (Wed, 13 Jul 2011)
@@ -31,8 +31,8 @@
BOOST_PP_ASSERT_IS_LIST((4,(x,BOOST_PP_NIL)))
BOOST_PP_ASSERT_IS_LIST(((3,6m,irj),(x,BOOST_PP_NIL)))
BOOST_PP_ASSERT_IS_SEQ((x)(y)(z)(2)(3)(4))
-// BOOST_PP_ASSERT_IS_SEQ((x)(y)(z)((1,2))(3)(4))
-// BOOST_PP_ASSERT_IS_SEQ((x)(y)(z)((1,2))(3)((4,(x,BOOST_PP_NIL))))
-// BOOST_PP_ASSERT_IS_SEQ((x)(y)((x)(y)(z)(2)(3)(4))((1,2))(3)((4,(x,BOOST_PP_NIL))))
+BOOST_PP_ASSERT_IS_SEQ((x)(y)(z)((1,2))(3)(4))
+BOOST_PP_ASSERT_IS_SEQ((x)(y)(z)((1,2))(3)((4,(x,BOOST_PP_NIL))))
+BOOST_PP_ASSERT_IS_SEQ((x)(y)((x)(y)(z)(2)(3)(4))((1,2))(3)((4,(x,BOOST_PP_NIL))))
# endif
\ No newline at end of file
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk