Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63864 - in sandbox/SOC/2010/bit_masks/boost/integer: . detail/bft detail/bft/msvc_fixes/msvc9
From: bbartmanboost_at_[hidden]
Date: 2010-07-11 09:46:55


Author: bbartman
Date: 2010-07-11 09:46:54 EDT (Sun, 11 Jul 2010)
New Revision: 63864
URL: http://svn.boost.org/trac/boost/changeset/63864

Log:
completed another draft of the make_bitfield_tuple function for MSVC
Text files modified:
   sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp | 5 ---
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/make_bitfield_tuple.hpp | 5 +++
   sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/msvc_fixes/msvc9/msvc_make_bitfield_tuple_fix.hpp | 52 ++++++++++++++++++++++++++++++++++++++++
   3 files changed, 56 insertions(+), 6 deletions(-)

Modified: sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/bitfield_tuple.hpp 2010-07-11 09:46:54 EDT (Sun, 11 Jul 2010)
@@ -32,11 +32,6 @@
     : protected detail::bitfield_tuple_base<
         BOOST_BFT_PARAMETER_LIST()
>
-#ifdef BOOST_MSVC
- , boost::detail::msvc_fixes::msvc9_make_bft_fix<
- bitfield_tuple<BOOST_BFT_PARAMETER_LIST()>
- >
-#endif
 {
 private:
     typedef detail::bitfield_tuple_base<BOOST_BFT_PARAMETER_LIST()> _base;

Modified: sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/make_bitfield_tuple.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/make_bitfield_tuple.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/make_bitfield_tuple.hpp 2010-07-11 09:46:54 EDT (Sun, 11 Jul 2010)
@@ -104,7 +104,7 @@
 #endif
 
 
-#ifndef BOOST_MSVC
+
 /** This is a function which is used to assign a value into a bitfield_tuple
  * as well as remove the actual mpl::void_* from the parameter list through
  * specialization.
@@ -119,6 +119,8 @@
 
 } // end detail
 
+
+#ifndef BOOST_MSVC
 /** I really don't like having to do this but it really is the Only way
  * its possible (by using macros thats is)
  * This is used to create parameters for the static call function
@@ -165,6 +167,7 @@
  * parameters this function could possibly hold is as many as fifty. So
  * I felt that the name should reflect that.
  */
+
 template <typename BitfieldTuple>
 BitfieldTuple make_bitfield_tuple(
     BOOST_MAKE_BITFIELD_TUPLE_CREATE_FUNCTION_PARAMETERS())

Modified: sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/msvc_fixes/msvc9/msvc_make_bitfield_tuple_fix.hpp
==============================================================================
--- sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/msvc_fixes/msvc9/msvc_make_bitfield_tuple_fix.hpp (original)
+++ sandbox/SOC/2010/bit_masks/boost/integer/detail/bft/msvc_fixes/msvc9/msvc_make_bitfield_tuple_fix.hpp 2010-07-11 09:46:54 EDT (Sun, 11 Jul 2010)
@@ -36,5 +36,57 @@
     BOOST_MAKE_BFT_COMPENSATE_FOR_MSVC()
 };
 
+
+/** Used to help generate psudo variadic template paramerer apperance.
+ * This make the typename T##N = mpl::void_ pattern.
+ */
+#define BOOST_MAKE_BFT_PARAM(z, n, data ) \
+ typename T ## n = mpl::void_*
+
+/** Makes the T0 through TN parameter list for the
+ * Generates pattern.
+ * typename T0 = mpl::void_*, ... typename TN = mpl::void_*
+ */
+#define BOOST_MAKE_BFT_TEMPLATE_PARAMETERS() \
+ BOOST_PP_ENUM( BOOST_BFT_PARAM_COUNT,\
+ BOOST_MAKE_BFT_PARAM, \
+ BOOST_BFT_NOTHING )
+
+
+/** Used for generating a single funciton parameter for the make_bitfield_tuple
+ * function template.
+ */
+#define BOOST_MAKE_BFT_FUNCTION_PARAM(z, n, data ) \
+ T ## n parameter ## n = 0
+
+/** used for generating the parameters for a the make_bitfield_tuple
+ * funciton.
+ * Generates pattern
+ * T0 = 0, ... TN = 0
+ */
+#define BOOST_MAKE_BFT_FUNCTION_PARAMETERS() \
+ BOOST_PP_ENUM( BOOST_BFT_PARAM_COUNT,\
+ BOOST_MAKE_BFT_FUNCTION_PARAM, \
+ BOOST_BFT_NOTHING )
+
+#define BOOST_MAKE_BFT_ASSIGN_FUNCTION_CALL(z,n,data)\
+ detail::assign_parameter_to_bft<n>(bft, parameter##n);
+
+#define BOOST_MAKE_BFT_GENERATE_ASSIGNMENT_CALLS() \
+ BOOST_PP_REPEAT_FROM_TO( \
+ 0,\
+ BOOST_BFT_PARAM_COUNT, \
+ BOOST_MAKE_BFT_ASSIGN_FUNCTION_CALL,\
+ BOOST_BFT_NOTHING )
+
+
+template <typename BitfieldTuple, BOOST_MAKE_BFT_TEMPLATE_PARAMETERS()>
+BitfieldTuple make_bitfield_tuple(BOOST_MAKE_BFT_FUNCTION_PARAMETERS()) {
+ BitfieldTuple bft;
+ BOOST_MAKE_BFT_GENERATE_ASSIGNMENT_CALLS();
+ return bft;
+}
+
+
 }}} // end boost::detail::msvc_fixes
 #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