|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r70601 - in branches/pplib/variadics/boost/preprocessor: seq tuple
From: eldiener_at_[hidden]
Date: 2011-03-26 18:37:41
Author: eldiener
Date: 2011-03-26 18:37:39 EDT (Sat, 26 Mar 2011)
New Revision: 70601
URL: http://svn.boost.org/trac/boost/changeset/70601
Log:
Seq and tuple changes.
Text files modified:
branches/pplib/variadics/boost/preprocessor/seq/to_list.hpp | 42 +++++++++++++++++++++++++++++++++++++--
branches/pplib/variadics/boost/preprocessor/tuple/eat.hpp | 10 +++++++++
branches/pplib/variadics/boost/preprocessor/tuple/elem.hpp | 1
branches/pplib/variadics/boost/preprocessor/tuple/rem.hpp | 18 +++++++++++++++++
branches/pplib/variadics/boost/preprocessor/tuple/reverse.hpp | 29 ++++++++++++++++++++++++--
branches/pplib/variadics/boost/preprocessor/tuple/to_array.hpp | 24 +++++++++++++++++++++
branches/pplib/variadics/boost/preprocessor/tuple/to_list.hpp | 26 ++++++++++++++++++++++-
branches/pplib/variadics/boost/preprocessor/tuple/to_seq.hpp | 26 ++++++++++++++++++++++-
8 files changed, 165 insertions(+), 11 deletions(-)
Modified: branches/pplib/variadics/boost/preprocessor/seq/to_list.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/seq/to_list.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/seq/to_list.hpp 2011-03-26 18:37:39 EDT (Sat, 26 Mar 2011)
@@ -1,6 +1,6 @@
# /* **************************************************************************
# * *
-# * (C) Copyright Edward Diener 2011.
+# * (C) Copyright Paul Mensonides 2011.
# * 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)
@@ -12,6 +12,42 @@
# ifndef BOOST_PREPROCESSOR_SEQ_TO_LIST_HPP
# define BOOST_PREPROCESSOR_SEQ_TO_LIST_HPP
#
-#define BOOST_PP_SEQ_TO_LIST(seq) \
-/**/
+# include <boost/preprocessor/cat.hpp>
+# include <boost/preprocessor/facilities/empty.hpp>
+# include <boost/preprocessor/punctuation/comma.hpp>
+# include <boost/preprocessor/punctuation/paren.hpp>
+#
+# /* BOOST_PP_SEQ_TO_LIST */
+#
+# define BOOST_PP_SEQ_TO_LIST(seq) \
+ BOOST_PP_SEQ_TO_LIST_I( \
+ BOOST_PP_CAT(BOOST_PP_SEQ_TO_LIST_A seq, 0) \
+ BOOST_PP_CAT(BOOST_PP_SEQ_TO_LIST_C seq, 0) \
+ ) \
+ /**/
+# define BOOST_PP_SEQ_TO_LIST_A(x) BOOST_PP_SEQ_TO_LIST_AB(x, B)
+# define BOOST_PP_SEQ_TO_LIST_B(x) BOOST_PP_SEQ_TO_LIST_AB(x, A)
+#
+# define BOOST_PP_SEQ_TO_LIST_AB(x, suffix) \
+ (BOOST_PP_LPAREN)(x BOOST_PP_EMPTY)(BOOST_PP_COMMA) BOOST_PP_SEQ_TO_LIST_ ## suffix \
+ /**/
+#
+# define BOOST_PP_SEQ_TO_LIST_A0 (BOOST_PP_NIL BOOST_PP_EMPTY)
+# define BOOST_PP_SEQ_TO_LIST_B0 (BOOST_PP_NIL BOOST_PP_EMPTY)
+#
+# define BOOST_PP_SEQ_TO_LIST_C(x) (BOOST_PP_RPAREN) BOOST_PP_SEQ_TO_LIST_D
+# define BOOST_PP_SEQ_TO_LIST_D(x) (BOOST_PP_RPAREN) BOOST_PP_SEQ_TO_LIST_C
+#
+# define BOOST_PP_SEQ_TO_LIST_C0
+# define BOOST_PP_SEQ_TO_LIST_D0
+#
+# define BOOST_PP_SEQ_TO_LIST_I(seq) \
+ BOOST_PP_CAT(BOOST_PP_SEQ_TO_LIST_X seq, 0) \
+ /**/
+# define BOOST_PP_SEQ_TO_LIST_X(c) c() BOOST_PP_SEQ_TO_LIST_Y
+# define BOOST_PP_SEQ_TO_LIST_Y(c) c() BOOST_PP_SEQ_TO_LIST_X
+#
+# define BOOST_PP_SEQ_TO_LIST_X0
+# define BOOST_PP_SEQ_TO_LIST_Y0
+#
# endif // BOOST_PREPROCESSOR_SEQ_TO_LIST_HPP
Modified: branches/pplib/variadics/boost/preprocessor/tuple/eat.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/tuple/eat.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/tuple/eat.hpp 2011-03-26 18:37:39 EDT (Sat, 26 Mar 2011)
@@ -14,6 +14,15 @@
# ifndef BOOST_PREPROCESSOR_TUPLE_EAT_HPP
# define BOOST_PREPROCESSOR_TUPLE_EAT_HPP
#
+# include <boost/preprocessor/config/variadics.hpp>
+#
+# if BOOST_PP_VARIADICS
+#
+#define BOOST_PP_TUPLE_EAT(size) BOOST_PP_DETAIL_TUPLE_EAT
+#define BOOST_PP_DETAIL_TUPLE_EAT(...)
+#
+# else
+#
# include <boost/preprocessor/config/config.hpp>
#
# /* BOOST_PP_TUPLE_EAT */
@@ -55,3 +64,4 @@
# define BOOST_PP_TUPLE_EAT_25(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y)
#
# endif
+# endif
Modified: branches/pplib/variadics/boost/preprocessor/tuple/elem.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/tuple/elem.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/tuple/elem.hpp 2011-03-26 18:37:39 EDT (Sat, 26 Mar 2011)
@@ -27,6 +27,7 @@
/**/
# define BOOST_PP_TUPLE_ELEM_2(i, tuple) BOOST_PP_VARIADIC_ELEM(i,BOOST_PP_TUPLE_ENUM(tuple))
# define BOOST_PP_TUPLE_ELEM_3(size, i, tuple) BOOST_PP_TUPLE_ELEM_2(i, tuple)
+#
# else
#
# include <boost/preprocessor/config/config.hpp>
Modified: branches/pplib/variadics/boost/preprocessor/tuple/rem.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/tuple/rem.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/tuple/rem.hpp 2011-03-26 18:37:39 EDT (Sat, 26 Mar 2011)
@@ -12,6 +12,23 @@
# ifndef BOOST_PREPROCESSOR_TUPLE_REM_HPP
# define BOOST_PREPROCESSOR_TUPLE_REM_HPP
#
+# include <boost/preprocessor/config/variadics.hpp>
+#
+# if BOOST_PP_VARIADICS
+#
+# include <boost/preprocessor/facilities/overload.hpp>
+#
+#define BOOST_PP_TUPLE_REM(size) BOOST_PP_DETAIL_TUPLE_REM
+#define BOOST_PP_DETAIL_TUPLE_REM(...) __VA_ARGS__
+#
+# define BOOST_PP_TUPLE_REM_CTOR(...) \
+ BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_REM_CTOR_, __VA_ARGS__)(__VA_ARGS__) \
+ /**/
+# define BOOST_PP_TUPLE_REM_CTOR_1(tuple) BOOST_PP_DETAIL_TUPLE_REM tuple
+# define BOOST_PP_TUPLE_REM_CTOR_2(size, tuple) BOOST_PP_TUPLE_REM_CTOR_1(tuple)
+#
+# else
+#
# include <boost/preprocessor/config/config.hpp>
#
# /* BOOST_PP_TUPLE_REM */
@@ -70,3 +87,4 @@
# endif
#
# endif
+# endif
Modified: branches/pplib/variadics/boost/preprocessor/tuple/reverse.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/tuple/reverse.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/tuple/reverse.hpp 2011-03-26 18:37:39 EDT (Sat, 26 Mar 2011)
@@ -14,12 +14,35 @@
# ifndef BOOST_PREPROCESSOR_TUPLE_REVERSE_HPP
# define BOOST_PREPROCESSOR_TUPLE_REVERSE_HPP
#
-# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/config/variadics.hpp>
+#
+# if BOOST_PP_VARIADICS
+#
+# include <boost/preprocessor/facilities/overload.hpp>
+# include <boost/preprocessor/tuple/size.hpp>
+#
+# /* BOOST_PP_TUPLE_REVERSE */
+#
+# define BOOST_PP_TUPLE_REVERSE(...) \
+ BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_DETAIL_REVERSE_, __VA_ARGS__)(__VA_ARGS__) \
+ /**/
+# define BOOST_PP_TUPLE_DETAIL_REVERSE_1(tuple) \
+ BOOST_PP_TUPLE_DETAIL_REVERSE_2(BOOST_PP_TUPLE_SIZE(tuple),tuple) \
+ /**/
+# define BOOST_PP_TUPLE_DETAIL_REVERSE_2(size, tuple) BOOST_PP_TUPLE_REVERSE_COMMON(size, tuple)
+#
+# else
#
# /* BOOST_PP_TUPLE_REVERSE */
#
+# define BOOST_PP_TUPLE_REVERSE(size, tuple) BOOST_PP_TUPLE_REVERSE_COMMON(size, tuple)
+#
+# endif // BOOST_PP_VARIADICS
+#
+# include <boost/preprocessor/config/config.hpp>
+#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
-# define BOOST_PP_TUPLE_REVERSE(size, tuple) BOOST_PP_TUPLE_REVERSE_I(size, tuple)
+# define BOOST_PP_TUPLE_REVERSE_COMMON(size, tuple) BOOST_PP_TUPLE_REVERSE_I(size, tuple)
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
# define BOOST_PP_TUPLE_REVERSE_I(s, t) BOOST_PP_TUPLE_REVERSE_ ## s t
# else
@@ -27,7 +50,7 @@
# define BOOST_PP_TUPLE_REVERSE_II(res) res
# endif
# else
-# define BOOST_PP_TUPLE_REVERSE(size, tuple) BOOST_PP_TUPLE_REVERSE_OO((size, tuple))
+# define BOOST_PP_TUPLE_REVERSE_COMMON(size, tuple) BOOST_PP_TUPLE_REVERSE_OO((size, tuple))
# define BOOST_PP_TUPLE_REVERSE_OO(par) BOOST_PP_TUPLE_REVERSE_I ## par
# define BOOST_PP_TUPLE_REVERSE_I(s, t) BOOST_PP_TUPLE_REVERSE_ ## s ## t
# endif
Modified: branches/pplib/variadics/boost/preprocessor/tuple/to_array.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/tuple/to_array.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/tuple/to_array.hpp 2011-03-26 18:37:39 EDT (Sat, 26 Mar 2011)
@@ -12,6 +12,28 @@
# ifndef BOOST_PREPROCESSOR_TUPLE_TO_ARRAY_HPP
# define BOOST_PREPROCESSOR_TUPLE_TO_ARRAY_HPP
#
-#define BOOST_PP_TUPLE_TO_ARRAY(array) \
+# include <boost/preprocessor/config/variadics.hpp>
+#
+#if BOOST_PP_VARIADICS
+#
+# include <boost/preprocessor/facilities/overload.hpp>
+# include <boost/preprocessor/tuple/size.hpp>
+#
+# define BOOST_PP_TUPLE_TO_ARRAY(...) \
+ BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_TO_ARRAY_, __VA_ARGS__)(__VA_ARGS__) \
+ /**/
+# define BOOST_PP_TUPLE_TO_ARRAY_1(tuple) \
+ BOOST_PP_TUPLE_TO_ARRAY_2(BOOST_PP_TUPLE_SIZE(tuple),tuple) \
+ /**/
+# define BOOST_PP_TUPLE_TO_ARRAY_2(size, tuple) \
+ ( size, tuple ) \
/**/
+#
+# else
+#
+#define BOOST_PP_TUPLE_TO_ARRAY(size,tuple) \
+ ( size, tuple ) \
+/**/
+#
+# endif // BOOST_PP_VARIADICS
# endif // BOOST_PREPROCESSOR_TUPLE_TO_ARRAY_HPP
Modified: branches/pplib/variadics/boost/preprocessor/tuple/to_list.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/tuple/to_list.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/tuple/to_list.hpp 2011-03-26 18:37:39 EDT (Sat, 26 Mar 2011)
@@ -15,11 +15,33 @@
# define BOOST_PREPROCESSOR_TUPLE_TO_LIST_HPP
#
# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/config/variadics.hpp>
+#
+# if BOOST_PP_VARIADICS
+#
+# include <boost/preprocessor/facilities/overload.hpp>
+# include <boost/preprocessor/tuple/size.hpp>
#
# /* BOOST_PP_TUPLE_TO_LIST */
#
+# define BOOST_PP_TUPLE_TO_LIST(...) \
+ BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_DETAIL_TO_LIST_, __VA_ARGS__)(__VA_ARGS__) \
+ /**/
+# define BOOST_PP_TUPLE_DETAIL_TO_LIST_1(tuple) \
+ BOOST_PP_TUPLE_DETAIL_TO_LIST_2(BOOST_PP_TUPLE_SIZE(tuple),tuple) \
+ /**/
+# define BOOST_PP_TUPLE_DETAIL_TO_LIST_2(size, tuple) BOOST_PP_TUPLE_TO_LIST_COMMON(size, tuple)
+#
+# else
+#
+# /* BOOST_PP_TUPLE_TO_LIST */
+#
+# define BOOST_PP_TUPLE_TO_LIST(size, tuple) BOOST_PP_TUPLE_TO_LIST_COMMON(size, tuple)
+#
+# endif // BOOST_PP_VARIADICS
+#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
-# define BOOST_PP_TUPLE_TO_LIST(size, tuple) BOOST_PP_TUPLE_TO_LIST_I(size, tuple)
+# define BOOST_PP_TUPLE_TO_LIST_COMMON(size, tuple) BOOST_PP_TUPLE_TO_LIST_I(size, tuple)
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
# define BOOST_PP_TUPLE_TO_LIST_I(s, t) BOOST_PP_TUPLE_TO_LIST_ ## s t
# else
@@ -27,7 +49,7 @@
# define BOOST_PP_TUPLE_TO_LIST_II(res) res
# endif
# else
-# define BOOST_PP_TUPLE_TO_LIST(size, tuple) BOOST_PP_TUPLE_TO_LIST_OO((size, tuple))
+# define BOOST_PP_TUPLE_TO_LIST_COMMON(size, tuple) BOOST_PP_TUPLE_TO_LIST_OO((size, tuple))
# define BOOST_PP_TUPLE_TO_LIST_OO(par) BOOST_PP_TUPLE_TO_LIST_I ## par
# define BOOST_PP_TUPLE_TO_LIST_I(s, t) BOOST_PP_TUPLE_TO_LIST_ ## s ## t
# endif
Modified: branches/pplib/variadics/boost/preprocessor/tuple/to_seq.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/tuple/to_seq.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/tuple/to_seq.hpp 2011-03-26 18:37:39 EDT (Sat, 26 Mar 2011)
@@ -13,11 +13,33 @@
# define BOOST_PREPROCESSOR_TUPLE_TO_SEQ_HPP
#
# include <boost/preprocessor/config/config.hpp>
+# include <boost/preprocessor/config/variadics.hpp>
+#
+# if BOOST_PP_VARIADICS
+#
+# include <boost/preprocessor/facilities/overload.hpp>
+# include <boost/preprocessor/tuple/size.hpp>
#
# /* BOOST_PP_TUPLE_TO_SEQ */
#
+# define BOOST_PP_TUPLE_TO_SEQ(...) \
+ BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_DETAIL_TO_SEQ_, __VA_ARGS__)(__VA_ARGS__) \
+ /**/
+# define BOOST_PP_TUPLE_DETAIL_TO_SEQ_1(tuple) \
+ BOOST_PP_TUPLE_DETAIL_TO_SEQ_2(BOOST_PP_TUPLE_SIZE(tuple),tuple) \
+ /**/
+# define BOOST_PP_TUPLE_DETAIL_TO_SEQ_2(size, tuple) BOOST_PP_TUPLE_TO_SEQ_COMMON(size, tuple)
+#
+# else
+#
+# /* BOOST_PP_TUPLE_TO_SEQ */
+#
+# define BOOST_PP_TUPLE_TO_SEQ(size, tuple) BOOST_PP_TUPLE_TO_SEQ_COMMON(size, tuple)
+#
+# endif // BOOST_PP_VARIADICS
+#
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
-# define BOOST_PP_TUPLE_TO_SEQ(size, tuple) BOOST_PP_TUPLE_TO_SEQ_I(size, tuple)
+# define BOOST_PP_TUPLE_TO_SEQ_COMMON(size, tuple) BOOST_PP_TUPLE_TO_SEQ_I(size, tuple)
# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MSVC()
# define BOOST_PP_TUPLE_TO_SEQ_I(s, t) BOOST_PP_TUPLE_TO_SEQ_ ## s t
# else
@@ -25,7 +47,7 @@
# define BOOST_PP_TUPLE_TO_SEQ_II(res) res
# endif
# else
-# define BOOST_PP_TUPLE_TO_SEQ(size, tuple) BOOST_PP_TUPLE_TO_SEQ_OO((size, tuple))
+# define BOOST_PP_TUPLE_TO_SEQ_COMMON(size, tuple) BOOST_PP_TUPLE_TO_SEQ_OO((size, tuple))
# define BOOST_PP_TUPLE_TO_SEQ_OO(par) BOOST_PP_TUPLE_TO_SEQ_I ## par
# define BOOST_PP_TUPLE_TO_SEQ_I(s, t) BOOST_PP_TUPLE_TO_SEQ_ ## s ## t
# endif
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