|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r71007 - in branches/pplib/variadics: boost/preprocessor/config boost/preprocessor/variadic/detail libs/preprocessor/test
From: eldiener_at_[hidden]
Date: 2011-04-05 14:29:14
Author: eldiener
Date: 2011-04-05 14:29:13 EDT (Tue, 05 Apr 2011)
New Revision: 71007
URL: http://svn.boost.org/trac/boost/changeset/71007
Log:
Added new limits for variadics. and some more comments, as well as updating tests.
Added:
branches/pplib/variadics/libs/preprocessor/test/variadic.cpp (contents, props changed)
Text files modified:
branches/pplib/variadics/boost/preprocessor/config/limits.hpp | 1 +
branches/pplib/variadics/boost/preprocessor/config/variadics.hpp | 12 ++++--------
branches/pplib/variadics/boost/preprocessor/variadic/detail/size.hpp | 8 ++++++++
branches/pplib/variadics/libs/preprocessor/test/tuple.cpp | 3 ---
4 files changed, 13 insertions(+), 11 deletions(-)
Modified: branches/pplib/variadics/boost/preprocessor/config/limits.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/config/limits.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/config/limits.hpp 2011-04-05 14:29:13 EDT (Tue, 05 Apr 2011)
@@ -25,5 +25,6 @@
# define BOOST_PP_LIMIT_SEQ 256
# define BOOST_PP_LIMIT_SLOT_SIG 10
# define BOOST_PP_LIMIT_SLOT_COUNT 5
+# define BOOST_PP_LIMIT_VARIADIC 25
#
# endif
Modified: branches/pplib/variadics/boost/preprocessor/config/variadics.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/config/variadics.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/config/variadics.hpp 2011-04-05 14:29:13 EDT (Tue, 05 Apr 2011)
@@ -14,7 +14,7 @@
#
# if !defined(BOOST_PP_VARIADICS)
#
-# if 1
+# if !defined(BOOST_PP_USE_BOOST_CONFIG)
/* This is the code we will use. It is essentially a duplication
of the code in Boost Config. If we could ever use Boost Config
in the future, we can change the above line to #if 0.
@@ -148,20 +148,16 @@
#define BOOST_PP_VARIADICS 1
#endif
#
-# else // !1
-/* This is the ideal code, but will not work until Boost Config
- works with C compilers or C++ compilers in C mode. I will be
- working on that to see if I can make it happen in the future.
-*/
+# else
# include <boost/config.hpp>
#
# if defined(BOOST_NO_VARIADIC_MACROS)
# define BOOST_PP_VARIADICS 0
# else
# define BOOST_PP_VARIADICS 1
-# endif // !BOOST_NO_VARIADIC_MACROS
+# endif // BOOST_NO_VARIADIC_MACROS
#
-# endif // 1
+# endif // BOOST_PP_USE_BOOST_CONFIG
#
# endif // BOOST_PP_VARIADICS
#
Modified: branches/pplib/variadics/boost/preprocessor/variadic/detail/size.hpp
==============================================================================
--- branches/pplib/variadics/boost/preprocessor/variadic/detail/size.hpp (original)
+++ branches/pplib/variadics/boost/preprocessor/variadic/detail/size.hpp 2011-04-05 14:29:13 EDT (Tue, 05 Apr 2011)
@@ -24,6 +24,14 @@
# include <boost/preprocessor/facilities/empty.hpp>
# endif
#
+/*
+ The maximum size currently supported for variadic
+ data in the library is 25, as given by the following
+ two macros. If we change this we also
+ need to change it in the internal copy ( under a different
+ name to avoid recursion ) of the same functionality in
+ the header file 'facilities/overload.hpp'.
+*/
#define BOOST_PP_VARIADIC_DETAIL_ARG_N( \
A1,A2,A3,A4,A5,A6,A7,A8,A9,A10, \
A11,A12,A13,A14,A15,A16,A17,A18,A19,A20, \
Modified: branches/pplib/variadics/libs/preprocessor/test/tuple.cpp
==============================================================================
--- branches/pplib/variadics/libs/preprocessor/test/tuple.cpp (original)
+++ branches/pplib/variadics/libs/preprocessor/test/tuple.cpp 2011-04-05 14:29:13 EDT (Tue, 05 Apr 2011)
@@ -12,9 +12,6 @@
# /* See http://www.boost.org for most recent version. */
#
# include <boost/preprocessor/tuple.hpp>
-# include <boost/preprocessor/arithmetic/add.hpp>
-# include <boost/preprocessor/cat.hpp>
-# include <boost/preprocessor/control/if.hpp>
# include <boost/preprocessor/array/elem.hpp>
# include <boost/preprocessor/list/at.hpp>
# include <boost/preprocessor/seq/elem.hpp>
Added: branches/pplib/variadics/libs/preprocessor/test/variadic.cpp
==============================================================================
--- (empty file)
+++ branches/pplib/variadics/libs/preprocessor/test/variadic.cpp 2011-04-05 14:29:13 EDT (Tue, 05 Apr 2011)
@@ -0,0 +1,40 @@
+# /* **************************************************************************
+# * *
+# * (C) Copyright Edward Diener 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)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# include <boost/preprocessor/variadic.hpp>
+# include <boost/preprocessor/array/size.hpp>
+# include <boost/preprocessor/array/elem.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/size.hpp>
+# include <boost/preprocessor/tuple/elem.hpp>
+# include <libs/preprocessor/test/test.h>
+
+#if BOOST_PP_VARIADICS
+
+#define VDATA 0,1,2,3,4,5,6
+
+BEGIN BOOST_PP_VARIADIC_ELEM(4,VDATA) == 4 END
+BEGIN BOOST_PP_VARIADIC_ELEM(6,7,11,3,8,14,85,56,92,165) == 56 END
+BEGIN BOOST_PP_VARIADIC_SIZE(VDATA) == 7 END
+BEGIN BOOST_PP_VARIADIC_SIZE(7,11,3,8,14,85,56,92,165) == 9 END
+BEGIN BOOST_PP_ARRAY_SIZE(BOOST_PP_VARIADIC_TO_ARRAY(VDATA)) == 7 END
+BEGIN BOOST_PP_ARRAY_ELEM(4,BOOST_PP_VARIADIC_TO_ARRAY(7,11,3,8,14,85,56,92,165)) == 14 END
+BEGIN BOOST_PP_LIST_AT(BOOST_PP_VARIADIC_TO_LIST(VDATA),3) == 3 END
+BEGIN BOOST_PP_LIST_SIZE(BOOST_PP_VARIADIC_TO_LIST(7,11,3,8,14,85,56,92,165)) == 9 END
+BEGIN BOOST_PP_SEQ_ELEM(5,BOOST_PP_VARIADIC_TO_SEQ(VDATA)) == 5 END
+BEGIN BOOST_PP_SEQ_SIZE(BOOST_PP_VARIADIC_TO_SEQ(7,11,3,8,14,85,56,92,165)) == 9 END
+BEGIN BOOST_PP_TUPLE_SIZE(BOOST_PP_VARIADIC_TO_TUPLE(VDATA)) == 7 END
+BEGIN BOOST_PP_TUPLE_ELEM(8,BOOST_PP_VARIADIC_TO_TUPLE(7,11,3,8,14,85,56,92,165)) == 165 END
+
+#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