Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73494 - in sandbox/variadic_macro_data: boost/variadic_macro_data boost/variadic_macro_data/detail libs/variadic_macro_data/test
From: eldiener_at_[hidden]
Date: 2011-08-02 12:13:36


Author: eldiener
Date: 2011-08-02 12:13:34 EDT (Tue, 02 Aug 2011)
New Revision: 73494
URL: http://svn.boost.org/trac/boost/changeset/73494

Log:
Updated IS_TUPLE_BEGIN for non-VC++
Text files modified:
   sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_common.hpp | 12 ------------
   sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_pplib.hpp | 15 +++++++++++++++
   sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_common.hpp | 16 ++++++++++++++--
   sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_native.hpp | 4 ++--
   sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_pplib.hpp | 6 +++---
   sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_is_empty.cpp | 3 +++
   6 files changed, 37 insertions(+), 19 deletions(-)

Modified: sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_common.hpp
==============================================================================
--- sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_common.hpp (original)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_common.hpp 2011-08-02 12:13:34 EDT (Tue, 02 Aug 2011)
@@ -28,18 +28,6 @@
 
 # define VMD_DETAIL_IS_EMPTY_SPLIT_0(a, ...) a
 # define VMD_DETAIL_IS_EMPTY_SPLIT_1(a, ...) __VA_ARGS__
-# define VMD_DETAIL_IS_EMPTY_IS_VARIADIC(...) \
- VMD_DETAIL_IS_EMPTY_SPLIT \
- ( \
- 0, \
- VMD_DETAIL_IS_EMPTY_CAT \
- ( \
- VMD_DETAIL_IS_EMPTY_IS_VARIADIC_R_, \
- VMD_DETAIL_IS_EMPTY_IS_VARIADIC_C __VA_ARGS__ \
- ) \
- ) \
-/**/
-
 # define VMD_DETAIL_IS_EMPTY_IS_VARIADIC_C(...) 1
 # define VMD_DETAIL_IS_EMPTY_IS_VARIADIC_R_1 1,
 # define VMD_DETAIL_IS_EMPTY_IS_VARIADIC_R_VMD_DETAIL_IS_EMPTY_IS_VARIADIC_C 0,

Modified: sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_pplib.hpp
==============================================================================
--- sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_pplib.hpp (original)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_pplib.hpp 2011-08-02 12:13:34 EDT (Tue, 02 Aug 2011)
@@ -10,8 +10,23 @@
 
 #if BOOST_VMD_MSVC
 
+#include <boost/preprocessor/arithmetic/dec.hpp>
 #include <boost/preprocessor/variadic/size.hpp>
 
+#define VMD_DETAIL_IS_EMPTY_VSIZE(...) VMD_DETAIL_IS_EMPTY_VSIZE2(__VA_ARGS__)
+#define VMD_DETAIL_IS_EMPTY_VSIZE2(...) VMD_DETAIL_IS_EMPTY_VSIZE3(__VA_ARGS__)
+#define VMD_DETAIL_IS_EMPTY_VSIZE3(...) BOOST_PP_VARIADIC_SIZE(__VA_ARGS__)
+
+#define VMD_DETAIL_IS_EMPTY_TUPLE_BEGIN(param) \
+ BOOST_PP_DEC \
+ ( \
+ VMD_DETAIL_IS_EMPTY_VSIZE \
+ ( \
+ VMD_DETAIL_IS_TUPLE_BEGIN_EXPAND param \
+ ) \
+ ) \
+/**/
+
 #endif /* BOOST_PP_VARIADICS_MSVC */
 
 #define VMD_DETAIL_REMOVE_PARENS(x) \

Modified: sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_common.hpp
==============================================================================
--- sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_common.hpp (original)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_common.hpp 2011-08-02 12:13:34 EDT (Tue, 02 Aug 2011)
@@ -42,17 +42,29 @@
 
 #if !BOOST_VMD_MSVC
 
+# define BOOST_VMD_IS_TUPLE_BEGIN(...) \
+ VMD_DETAIL_IS_EMPTY_SPLIT \
+ ( \
+ 0, \
+ VMD_DETAIL_IS_EMPTY_CAT \
+ ( \
+ VMD_DETAIL_IS_EMPTY_IS_VARIADIC_R_, \
+ VMD_DETAIL_IS_EMPTY_IS_VARIADIC_C __VA_ARGS__ \
+ ) \
+ ) \
+/**/
+
 #define BOOST_VMD_IS_EMPTY(...) \
     VMD_DETAIL_IS_EMPTY_IIF \
       ( \
- VMD_DETAIL_IS_EMPTY_IS_VARIADIC \
+ BOOST_VMD_IS_TUPLE_BEGIN \
         ( \
         __VA_ARGS__ \
         ) \
       ) \
       ( \
       0, \
- VMD_DETAIL_IS_EMPTY_IS_VARIADIC \
+ BOOST_VMD_IS_TUPLE_BEGIN \
         ( \
         VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C __VA_ARGS__ () \
         ) \

Modified: sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_native.hpp
==============================================================================
--- sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_native.hpp (original)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_native.hpp 2011-08-02 12:13:34 EDT (Tue, 02 Aug 2011)
@@ -326,6 +326,8 @@
   BOOST_VMD_PP_TUPLE_TO_DATA(BOOST_PP_SEQ_TO_TUPLE(seq)) \
 /**/
 
+#if BOOST_VMD_MSVC
+
 /// Tests whether its parameter begins with a tuple.
 /**
 
@@ -350,8 +352,6 @@
       ) \
 /**/
 
-#if BOOST_VMD_MSVC
-
 #define BOOST_VMD_IS_EMPTY(param) \
     VMD_DETAIL_IS_EMPTY_IIF \
       ( \

Modified: sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_pplib.hpp
==============================================================================
--- sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_pplib.hpp (original)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_pplib.hpp 2011-08-02 12:13:34 EDT (Tue, 02 Aug 2011)
@@ -340,6 +340,8 @@
   BOOST_PP_SEQ_ENUM(seq) \
 /**/
 
+#if BOOST_VMD_MSVC
+
 /// Tests whether its parameter begins with a tuple.
 /**
 
@@ -365,8 +367,6 @@
       ) \
 /**/
 
-#if BOOST_VMD_MSVC
-
 #define BOOST_VMD_IS_EMPTY(param) \
     VMD_DETAIL_IS_EMPTY_IIF \
       ( \
@@ -380,7 +380,7 @@
       ) \
       ( \
       VMD_DETAIL_IS_EMPTY_GEN_ZERO, \
- BOOST_VMD_IS_TUPLE_BEGIN \
+ VMD_DETAIL_IS_EMPTY_TUPLE_BEGIN \
       ) \
     (VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C param ()) \
 /**/

Modified: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_is_empty.cpp
==============================================================================
--- sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_is_empty.cpp (original)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_is_empty.cpp 2011-08-02 12:13:34 EDT (Tue, 02 Aug 2011)
@@ -11,6 +11,7 @@
   #define OBJECT2
   #define FUNC(x) FUNC2(x)
   #define FUNC2(x)
+ #define FUNC_GEN() ()
   
   BOOST_TEST(BOOST_VMD_IS_EMPTY());
   BOOST_TEST(BOOST_VMD_IS_EMPTY(DATA));
@@ -18,6 +19,8 @@
   BOOST_TEST(BOOST_VMD_IS_EMPTY(OBJECT));
   BOOST_TEST(BOOST_VMD_IS_EMPTY(FUNC(z)));
   
+// BOOST_TEST(BOOST_VMD_IS_EMPTY(FUNC_GEN));
+
 #endif
 
   return boost::report_errors();


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