|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73476 - 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-01 11:03:19
Author: eldiener
Date: 2011-08-01 11:03:17 EDT (Mon, 01 Aug 2011)
New Revision: 73476
URL: http://svn.boost.org/trac/boost/changeset/73476
Log:
Added BOOST_VMD_IS_EMPTY support.
Text files modified:
sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_common.hpp | 47 ++++++++++++++++++++++++++++++++++++++++
sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_native.hpp | 23 ++++++++++++++++---
sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_pplib.hpp | 20 +++++++++++++++++
sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_setup.hpp | 8 ++++++
sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_common.hpp | 21 +++++++++++++++++
sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_native.hpp | 22 ++++++++++++++++++
sandbox/variadic_macro_data/boost/variadic_macro_data/vmd_pplib.hpp | 22 ++++++++++++++++++
sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_array.cpp | 4 +-
sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_list.cpp | 4 +-
sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_sequence.cpp | 4 +-
sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_tuple.cpp | 4 +-
11 files changed, 167 insertions(+), 12 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-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -9,5 +9,52 @@
1,1 \
/**/
+#if BOOST_VMD_MSVC
+
+# define VMD_DETAIL_IS_EMPTY_IS_TUPLE_BEGIN_EXPAND(...) \
+ 1,1 \
+/**/
+
+# define VMD_DETAIL_IS_EMPTY_GEN_ZERO(x) 0
+# define VMD_DETAIL_IS_EMPTY_PRIMITIVE_CAT(a, b) a ## b
+# define VMD_DETAIL_IS_EMPTY_IIF_0(t, b) b
+# define VMD_DETAIL_IS_EMPTY_IIF_1(t, b) t
+
+#else
+
+# define VMD_DETAIL_IS_EMPTY_CAT(a, ...) VMD_DETAIL_IS_EMPTY_PRIMITIVE_CAT(a,__VA_ARGS__)
+# define VMD_DETAIL_IS_EMPTY_PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__
+# define VMD_DETAIL_IS_EMPTY_IIF_0(t, ...) __VA_ARGS__
+# define VMD_DETAIL_IS_EMPTY_IIF_1(t, ...) t
+# define VMD_DETAIL_IS_EMPTY_SPLIT(i, ...) \
+ VMD_DETAIL_IS_EMPTY_PRIMITIVE_CAT(VMD_DETAIL_IS_EMPTY_SPLIT_,i)(__VA_ARGS__) \
+/**/
+
+# 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,
+
+#endif /* BOOST_VMD_MSVC */
+
+# define VMD_DETAIL_IS_EMPTY_IIF(bit) \
+ VMD_DETAIL_IS_EMPTY_PRIMITIVE_CAT(VMD_DETAIL_IS_EMPTY_IIF_,bit) \
+/**/
+
+# define VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C() ()
+
#endif // BOOST_VMD_VARIADICS
#endif // VMD_DETAIL_COMMON_HPP
Modified: sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_native.hpp
==============================================================================
--- sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_native.hpp (original)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_native.hpp 2011-08-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -12,7 +12,8 @@
#include <boost/preprocessor/tuple/to_seq.hpp>
#include <boost/preprocessor/tuple/rem.hpp>
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
+#include <boost/preprocessor/arithmetic/dec.hpp>
#include <boost/preprocessor/facilities/empty.hpp>
#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
#define VMD_DETAIL_VD_CAT(a, b) VMD_DETAIL_VD_CAT_I(a, b)
@@ -26,7 +27,7 @@
#define VMD_DETAIL_VD_CAT_I(a, b) VMD_DETAIL_VD_CAT_II(a ## b)
#define VMD_DETAIL_VD_CAT_II(res) res
#endif
-#endif // defined(BOOST_MSVC)
+#endif // defined(BOOST_VMD_MSVC)
#define VMD_DETAIL_DATA_ELEM_0(p0, ...) p0
#define VMD_DETAIL_DATA_ELEM_1(p0, p1, ...) p1
@@ -126,7 +127,7 @@
#define VMD_DETAIL_PP_TUPLE_TO_DATA(tuple) \
VMD_DETAIL_REMOVE_TUPLE_PARENS tuple \
/**/
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
#define VMD_DETAIL_DATA_SIZE(...) \
VMD_DETAIL_VD_CAT(VMD_DETAIL_APPLY(VMD_DETAIL_ARG_N, (__VA_ARGS__, VMD_DETAIL_RSEQ_N())),BOOST_PP_EMPTY()) \
/**/
@@ -140,7 +141,7 @@
/**/
#define VMD_DETAIL_CAT(a, ...) VMD_DETAIL_PRIMITIVE_CAT(a, __VA_ARGS__)
#define VMD_DETAIL_PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
#define VMD_DETAIL_DATA_ELEM(n,...) \
VMD_DETAIL_VD_CAT(VMD_DETAIL_CAT(VMD_DETAIL_DATA_ELEM_, n)(__VA_ARGS__,),BOOST_PP_EMPTY()) \
/**/
@@ -177,5 +178,19 @@
BOOST_PP_IDENTITY(VMD_DETAIL_PP_TUPLE_TO_DATA(x)) \
/**/
+#if defined(BOOST_VMD_MSVC)
+
+# define VMD_DETAIL_IS_EMPTY_IS_TUPLE_BEGIN(x) \
+ BOOST_PP_DEC \
+ ( \
+ VMD_DETAIL_DATA_SIZE \
+ ( \
+ VMD_DETAIL_IS_EMPTY_IS_TUPLE_BEGIN_EXPAND x \
+ ) \
+ ) \
+/**/
+
+#endif /* BOOST_VMD_MSVC */
+
#endif // BOOST_VMD_VARIADICS
#endif // VMD_DETAIL_NATIVE_HPP
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-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -8,9 +8,29 @@
#include <boost/preprocessor/facilities/identity.hpp>
#include <boost/preprocessor/tuple/enum.hpp>
+#if BOOST_VMD_MSVC
+
+#include <boost/preprocessor/variadic/size.hpp>
+
+#endif /* BOOST_PP_VARIADICS_MSVC */
+
#define VMD_DETAIL_REMOVE_PARENS(x) \
BOOST_PP_IDENTITY(BOOST_PP_TUPLE_ENUM(x)) \
/**/
+#if BOOST_VMD_MSVC
+
+# define VMD_DETAIL_IS_EMPTY_IS_TUPLE_BEGIN(x) \
+ BOOST_PP_DEC \
+ ( \
+ BOOST_PP_VARIADIC_SIZE \
+ ( \
+ VMD_DETAIL_IS_EMPTY_IS_TUPLE_BEGIN_EXPAND x \
+ ) \
+ ) \
+/**/
+
+#endif /* BOOST_PP_VARIADICS_MSVC */
+
#endif // BOOST_VMD_VARIADICS
#endif // VMD_DETAIL_PPLIB_HPP
Modified: sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_setup.hpp
==============================================================================
--- sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_setup.hpp (original)
+++ sandbox/variadic_macro_data/boost/variadic_macro_data/detail/vmd_detail_setup.hpp 2011-08-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -9,6 +9,9 @@
#include <boost/preprocessor/config/config.hpp>
#if defined(BOOST_PP_VARIADICS)
#define BOOST_VMD_VARIADICS BOOST_PP_VARIADICS
+#if BOOST_VMD_VARIADICS
+#define BOOST_VMD_MSVC BOOST_PP_VARIADICS_MSVC
+#endif /* BOOST_VMD_VARIADICS */
#endif /* BOOST_PP_VARIADICS */
#endif /* BOOST_VMD_VARIADICS && BOOST_VMD_PPLIB */
@@ -16,6 +19,11 @@
#include <boost/config.hpp>
#if !defined(BOOST_NO_VARIADIC_MACROS)
#define BOOST_VMD_VARIADICS 1
+#if defined(BOOST_MSVC)
+#define BOOST_VMD_MSVC 1
+#else
+#define BOOST_VMD_MSVC 0
+#endif /* BOOST_MSVC */
#else
#define BOOST_VMD_VARIADICS 0
#endif /* BOOST_NO_VARIADIC_MACROS */
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-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -40,5 +40,26 @@
(param)() \
/**/
+#if !BOOST_VMD_MSVC
+
+#define BOOST_VMD_IS_EMPTY(...) \
+ VMD_DETAIL_IS_EMPTY_IIF \
+ ( \
+ VMD_DETAIL_IS_EMPTY_IS_VARIADIC \
+ ( \
+ __VA_ARGS__ \
+ ) \
+ ) \
+ ( \
+ 0, \
+ VMD_DETAIL_IS_EMPTY_IS_VARIADIC \
+ ( \
+ VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C __VA_ARGS__ () \
+ ) \
+ ) \
+/**/
+
+#endif
+
#endif // BOOST_VMD_VARIADICS
#endif // VMD_COMMON_HPP
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-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -350,5 +350,27 @@
) \
/**/
+#if BOOST_VMD_MSVC
+
+# define BOOST_VMD_IS_EMPTY(param) \
+ VMD_DETAIL_IS_EMPTY_IIF \
+ ( \
+ BOOST_PP_DEC \
+ ( \
+ BOOST_VMD_DATA_SIZE \
+ ( \
+ VMD_DETAIL_IS_EMPTY_IS_TUPLE_BEGIN_EXPAND param \
+ ) \
+ ) \
+ ) \
+ ( \
+ VMD_DETAIL_IS_EMPTY_GEN_ZERO, \
+ VMD_DETAIL_IS_EMPTY_IS_TUPLE_BEGIN \
+ ) \
+ (VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C param ()) \
+/**/
+
+#endif /* BOOST_VMD_MSVC */
+
#endif // BOOST_VMD_VARIADICS
#endif // VMD_NATIVE_HPP
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-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -365,5 +365,27 @@
) \
/**/
+#if BOOST_VMD_MSVC
+
+# define BOOST_VMD_IS_EMPTY(param) \
+ VMD_DETAIL_IS_EMPTY_IIF \
+ ( \
+ BOOST_PP_DEC \
+ ( \
+ BOOST_PP_VARIADIC_SIZE \
+ ( \
+ VMD_DETAIL_IS_EMPTY_IS_TUPLE_BEGIN_EXPAND param \
+ ) \
+ ) \
+ ) \
+ ( \
+ VMD_DETAIL_IS_EMPTY_GEN_ZERO, \
+ VMD_DETAIL_IS_EMPTY_IS_TUPLE_BEGIN \
+ ) \
+ (VMD_DETAIL_IS_EMPTY_NON_FUNCTION_C param ()) \
+/**/
+
+#endif /* BOOST_VMD_MSVC */
+
#endif // BOOST_VMD_VARIADICS
#endif // VMD_PPLIB_HPP
Modified: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_array.cpp
==============================================================================
--- sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_array.cpp (original)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_array.cpp 2011-08-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -34,7 +34,7 @@
} \
/**/
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
#pragma warning( push )
#pragma warning( disable : 4127 )
@@ -43,7 +43,7 @@
BOOST_PP_REPEAT(BOOST_PP_ARRAY_SIZE(VMD_TEST_ARRAY_NUMBERS),VMD_TEST_ADD_TO_INT,VMD_TEST_ARRAY_NUMBERS)
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
#pragma warning( pop )
Modified: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_list.cpp
==============================================================================
--- sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_list.cpp (original)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_list.cpp 2011-08-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -33,7 +33,7 @@
} \
/**/
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
#pragma warning( push )
#pragma warning( disable : 4127 )
@@ -42,7 +42,7 @@
BOOST_PP_REPEAT(BOOST_PP_LIST_SIZE(VMD_TEST_LIST_NUMBERS),VMD_TEST_ADD_TO_INT,VMD_TEST_LIST_NUMBERS)
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
#pragma warning( pop )
Modified: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_sequence.cpp
==============================================================================
--- sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_sequence.cpp (original)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_sequence.cpp 2011-08-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -33,7 +33,7 @@
} \
/**/
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
#pragma warning( push )
#pragma warning( disable : 4127 )
@@ -42,7 +42,7 @@
BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(VMD_TEST_SEQ_NUMBERS),VMD_TEST_ADD_TO_INT,VMD_TEST_SEQ_NUMBERS)
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
#pragma warning( pop )
Modified: sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_tuple.cpp
==============================================================================
--- sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_tuple.cpp (original)
+++ sandbox/variadic_macro_data/libs/variadic_macro_data/test/test_data_as_tuple.cpp 2011-08-01 11:03:17 EDT (Mon, 01 Aug 2011)
@@ -43,7 +43,7 @@
} \
/**/
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
#pragma warning( push )
#pragma warning( disable : 4127 )
@@ -52,7 +52,7 @@
BOOST_PP_REPEAT(BOOST_VMD_PP_TUPLE_SIZE(VMD_TEST_TUPLE_NUMBERS),VMD_TEST_ADD_TO_INT,VMD_TEST_TUPLE_NUMBERS)
-#if defined(BOOST_MSVC)
+#if defined(BOOST_VMD_MSVC)
#pragma warning( pop )
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