Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63058 - in sandbox/SOC/2010/phoenix3/boost/phoenix: core support support/detail
From: thom.heller_at_[hidden]
Date: 2010-06-17 15:26:00


Author: theller
Date: 2010-06-17 15:25:59 EDT (Thu, 17 Jun 2010)
New Revision: 63058
URL: http://svn.boost.org/trac/boost/changeset/63058

Log:
+ cleaned up file iteration defines
+ minor macro tweaks to improve compile times

Added:
   sandbox/SOC/2010/phoenix3/boost/phoenix/support/detail/iterate_define.hpp (contents, props changed)
   sandbox/SOC/2010/phoenix3/boost/phoenix/support/detail/iterate_undef.hpp (contents, props changed)
Text files modified:
   sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp | 17 ----
   sandbox/SOC/2010/phoenix3/boost/phoenix/support/detail/iterate.hpp | 144 +--------------------------------------
   sandbox/SOC/2010/phoenix3/boost/phoenix/support/iterate.hpp | 31 +-------
   3 files changed, 10 insertions(+), 182 deletions(-)

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/core/actor.hpp 2010-06-17 15:25:59 EDT (Thu, 17 Jun 2010)
@@ -20,18 +20,6 @@
 #include <boost/phoenix/core/limits.hpp>
 #include <boost/phoenix/core/meta_grammar.hpp>
 #include <boost/phoenix/support/iterate.hpp>
-#include <boost/preprocessor/cat.hpp>
-#include <boost/preprocessor/comparison/less.hpp>
-#include <boost/preprocessor/control/if.hpp>
-#include <boost/preprocessor/facilities/expand.hpp>
-#include <boost/preprocessor/facilities/intercept.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/seq/enum.hpp>
-#include <boost/preprocessor/seq/fold_right.hpp>
-#include <boost/preprocessor/seq/for_each_i.hpp>
-#include <boost/preprocessor/seq/for_each_product.hpp>
-#include <boost/preprocessor/tuple/rem.hpp>
 #include <boost/proto/extends.hpp>
 #include <boost/proto/debug.hpp>
 #include <boost/utility/result_of.hpp>
@@ -73,13 +61,11 @@
             type;
         };
 
-#define PHOENIX_ITERATE_RESULT_OF 1
 #define PHOENIX_ITERATION_PARAMS \
         (4, (1, PHOENIX_ACTOR_LIMIT, \
         <boost/phoenix/core/actor.hpp>, \
         PHOENIX_ITERATE_RESULT_OF))
 #include PHOENIX_ITERATE()
-#undef PHOENIX_ITERATE_RESULT_OF
 
     }
 
@@ -116,14 +102,11 @@
             return eval(this->proto_base(), args);
         }
 
-#define PHOENIX_ITERATE_OPERATOR 2
 #define PHOENIX_ITERATION_PARAMS \
         (4, (1, PHOENIX_ACTOR_LIMIT, \
         <boost/phoenix/core/actor.hpp>, \
         PHOENIX_ITERATE_OPERATOR))
-
 #include PHOENIX_ITERATE()
-#undef PHOENIX_ITERATE_OPERATOR
 
     };
 }}

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/support/detail/iterate.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/support/detail/iterate.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/support/detail/iterate.hpp 2010-06-17 15:25:59 EDT (Thu, 17 Jun 2010)
@@ -7,9 +7,7 @@
 
 #if !BOOST_PP_IS_ITERATING
 
-#ifndef PHOENIX_SUPPORT_DETAIL_ITERATE_HPP
-#define PHOENIX_SUPPORT_DETAIL_ITERATE_HPP
-#endif
+#include <boost/preprocessor/tuple/elem.hpp>
 
 #ifndef PHOENIX_ITERATION_PARAMS
 #error "PHOENIX_ITERATION_PARAMS not define"
@@ -66,148 +64,18 @@
 #undef PHOENIX_IS_ITERATING
 #define PHOENIX_IS_ITERATING 1
 
-#define PHOENIX_ITERATION BOOST_PP_ITERATION()
-
-#undef PHOENIX_typename_A
-#undef PHOENIX_typename_A_void
-#undef PHOENIX_A
-#undef PHOENIX_A_a
-#undef PHOENIX_A_ref
-#undef PHOENIX_A_const_ref
-#undef PHOENIX_A_ref_a
-#undef PHOENIX_A_const_ref_a
-#undef PHOENIX_a
-
-#define PHOENIX_typename_A BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename A)
-
-#define PHOENIX_typename_A_void \
- BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(PHOENIX_ITERATION, typename A, void)
-
-#define PHOENIX_A \
- BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, A)
-
-#define PHOENIX_A_ref \
- BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, A, & BOOST_PP_INTERCEPT)
-
-#define PHOENIX_A_const_ref \
- BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, A, const& BOOST_PP_INTERCEPT)
-
-#define PHOENIX_A_a BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, A, a)
-
-#define PHOENIX_A_ref_a BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, A, & a)
-
-#define PHOENIX_A_const_ref_a \
- BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, A, const& a)
-
-#define PHOENIX_a \
- BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, a)
-
-#define PHOENIX_M0_R_P(_, PRODUCT) (PRODUCT)
-
-#define PHOENIX_M0_R(_, N, __) \
- (BOOST_PP_SEQ_FOR_EACH_PRODUCT( PHOENIX_M0_R_P, ((A ## N))((&)(const&))))
-
-#define PHOENIX_M0 BOOST_PP_REPEAT(PHOENIX_ITERATION, PHOENIX_M0_R, _)
-
-#define PHOENIX_M1_R_F(_, STATE, ELEM) STATE ELEM
-
-#define PHOENIX_M1_R(_, __, ___, ELEM) \
- (BOOST_PP_SEQ_FOLD_RIGHT \
- (PHOENIX_M1_R_F, BOOST_PP_SEQ_HEAD(ELEM), BOOST_PP_SEQ_TAIL(ELEM)))
+#include <boost/phoenix/support/detail/iterate_undef.hpp>
+#include <boost/phoenix/support/detail/iterate_define.hpp>
 
-#define PHOENIX_M1(R, PRODUCT) \
- ((BOOST_PP_SEQ_ENUM \
- (BOOST_PP_SEQ_FOR_EACH_I_R \
- (R, PHOENIX_M1_R, BOOST_PP_SEQ_SIZE( PRODUCT ), PRODUCT))))
-
-#define PHOENIX_M2_R(_, __, I, ELEM) \
- BOOST_PP_COMMA_IF(I) \
- BOOST_PP_SEQ_FOLD_LEFT \
- (PHOENIX_M1_R_F, BOOST_PP_SEQ_HEAD(ELEM), BOOST_PP_SEQ_TAIL(ELEM)) \
- a ## I
-
-#define PHOENIX_M2(R, PRODUCT) \
- ((BOOST_PP_SEQ_FOR_EACH_I_R(R, PHOENIX_M2_R, _, PRODUCT)))
-
-#define PHOENIX_SEQ_A BOOST_PP_SEQ_FOR_EACH_PRODUCT(PHOENIX_M1, PHOENIX_M0)
-
-#define PHOENIX_SEQ_A_a BOOST_PP_SEQ_FOR_EACH_PRODUCT(PHOENIX_M2, PHOENIX_M0)
-
-#define PHOENIX_PERM_SIZE BOOST_PP_SEQ_SIZE(PHOENIX_SEQ_A)
-
-#ifdef BOOST_MSVC
-
-#define PHOENIX_PERM_A(N) \
- BOOST_PP_TUPLE_REM(PHOENIX_ITERATION) BOOST_PP_SEQ_ELEM(N, PHOENIX_SEQ_A)
-
-#define PHOENIX_PERM_A_a(N) \
- BOOST_PP_TUPLE_REM(PHOENIX_ITERATION) BOOST_PP_SEQ_ELEM(N, PHOENIX_SEQ_A_a)
-
-#else
-
-#define PHOENIX_PERM_A(N) BOOST_PP_EXPAND \
- (BOOST_PP_TUPLE_REM(PHOENIX_ITERATION) BOOST_PP_SEQ_ELEM(N, PHOENIX_SEQ_A))
-
-#define PHOENIX_PERM_A_a(N) BOOST_PP_EXPAND \
- (BOOST_PP_TUPLE_REM(PHOENIX_ITERATION) BOOST_PP_SEQ_ELEM(N, PHOENIX_SEQ_A_a))
-
-#endif
 
 #include PHOENIX_ITERATION_FILE()
 
 #undef PHOENIX_ITERATION
-#undef PHOENIX_typename_A
-#undef PHOENIX_typename_A_void
-#undef PHOENIX_A
-#undef PHOENIX_PERM_A
-#undef PHOENIX_A_a
-#undef PHOENIX_A_ref
-#undef PHOENIX_A_const_ref
-#undef PHOENIX_A_ref_a
-#undef PHOENIX_A_const_ref_a
-#undef PHOENIX_PERM_A_a
-#undef PHOENIX_a
-
-#define PHOENIX_ITERATE() \
- <boost/phoenix/support/detail/iterate.hpp>
-
-#define PHOENIX_typename_A(N) BOOST_PP_ENUM_PARAMS(N, typename A)
-
-#define PHOENIX_typename_A_void(N) \
- BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N, typename A, void)
-
-#define PHOENIX_A(N) \
- BOOST_PP_ENUM_PARAMS(N, A)
-
-#define PHOENIX_A_ref(N) \
- BOOST_PP_ENUM_BINARY_PARAMS(N, A, & BOOST_PP_INTERCEPT)
-
-#define PHOENIX_A_const_ref(N) \
- BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& BOOST_PP_INTERCEPT)
-
-#define PHOENIX_A_a(N) BOOST_PP_ENUM_BINARY_PARAMS(N, A, a)
-
-#define PHOENIX_A_ref_a(N) BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)
-
-#define PHOENIX_A_const_ref_a(N) \
- BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a)
-
-#define PHOENIX_a(N) \
- BOOST_PP_ENUM_PARAMS(N, a)
-
-#undef PHOENIX_M0_R_P
-#undef PHOENIX_M0_R
-#undef PHOENIX_M0
-#undef PHOENIX_M1_R_F
-#undef PHOENIX_M1_R
-#undef PHOENIX_M1
-#undef PHOENIX_M2_R
-#undef PHOENIX_M2
-#undef PHOENIX_SEQ_A
-#undef PHOENIX_SEQ_A_a
-#undef PHOENIX_PERM_SIZE
 
 #undef PHOENIX_IS_ITERATING
 #define PHOENIX_IS_ITERATING 0
 
+#include <boost/phoenix/support/detail/iterate_undef.hpp>
+#include <boost/phoenix/support/detail/iterate_define.hpp>
+
 #endif

Added: sandbox/SOC/2010/phoenix3/boost/phoenix/support/detail/iterate_define.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/support/detail/iterate_define.hpp 2010-06-17 15:25:59 EDT (Thu, 17 Jun 2010)
@@ -0,0 +1,111 @@
+/*==============================================================================
+ Copyright (c) 2010 Thomas Heller
+
+ 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)
+==============================================================================*/
+
+#if !PHOENIX_IS_ITERATING
+
+#define PHOENIX_typename_A(N) BOOST_PP_ENUM_PARAMS(N, typename A)
+
+#define PHOENIX_typename_A_void(N) \
+ BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N, typename A, void)
+
+#define PHOENIX_A(N) \
+ BOOST_PP_ENUM_PARAMS(N, A)
+
+#define PHOENIX_A_ref(N) \
+ BOOST_PP_ENUM_BINARY_PARAMS(N, A, & BOOST_PP_INTERCEPT)
+
+#define PHOENIX_A_const_ref(N) \
+ BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& BOOST_PP_INTERCEPT)
+
+#define PHOENIX_A_a(N) BOOST_PP_ENUM_BINARY_PARAMS(N, A, a)
+
+#define PHOENIX_A_ref_a(N) BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)
+
+#define PHOENIX_A_const_ref_a(N) \
+ BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a)
+
+#define PHOENIX_a(N) \
+ BOOST_PP_ENUM_PARAMS(N, a)
+
+#else
+
+#include <boost/preprocessor/repetition/repeat.hpp>
+#include <boost/preprocessor/repetition/enum_binary_params.hpp>
+#include <boost/preprocessor/repetition/enum_params.hpp>
+#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
+#include <boost/preprocessor/seq/elem.hpp>
+#include <boost/preprocessor/seq/enum.hpp>
+#include <boost/preprocessor/seq/for_each_i.hpp>
+#include <boost/preprocessor/seq/for_each_product.hpp>
+#include <boost/preprocessor/seq/size.hpp>
+#include <boost/preprocessor/tuple/elem.hpp>
+
+#define PHOENIX_ITERATION BOOST_PP_ITERATION()
+
+#define PHOENIX_typename_A BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename A)
+
+#define PHOENIX_typename_A_void \
+ BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(PHOENIX_ITERATION, typename A, void)
+
+#define PHOENIX_A \
+ BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, A)
+
+#define PHOENIX_A_ref \
+ BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, A, & BOOST_PP_INTERCEPT)
+
+#define PHOENIX_A_const_ref \
+ BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, A, const& BOOST_PP_INTERCEPT)
+
+#define PHOENIX_A_a BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, A, a)
+
+#define PHOENIX_A_ref_a BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, A, & a)
+
+#define PHOENIX_A_const_ref_a \
+ BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, A, const& a)
+
+#define PHOENIX_a \
+ BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, a)
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Begin Perfect Forward argument permutation calculation
+ ////////////////////////////////////////////////////////////////////////////
+#define PHOENIX_M0_R(_, N, __) (((A ## N)(&))((A ## N)(const&)))
+
+#define PHOENIX_M0 BOOST_PP_REPEAT(PHOENIX_ITERATION, PHOENIX_M0_R, _)
+
+#define PHOENIX_M1_R_R(_, N, SEQ) BOOST_PP_SEQ_ELEM(N, SEQ)
+
+#define PHOENIX_M1_R(R, __, ___, ELEM) \
+ (BOOST_PP_REPEAT(BOOST_PP_SEQ_SIZE(ELEM), PHOENIX_M1_R_R, ELEM))
+
+#define PHOENIX_M1(R, PRODUCT) \
+ ((BOOST_PP_SEQ_ENUM \
+ (BOOST_PP_SEQ_FOR_EACH_I_R \
+ (R, PHOENIX_M1_R, _, PRODUCT))))
+
+#define PHOENIX_PERM_SEQ BOOST_PP_SEQ_FOR_EACH_PRODUCT(PHOENIX_M1, PHOENIX_M0)
+ ////////////////////////////////////////////////////////////////////////////
+ // End
+ ////////////////////////////////////////////////////////////////////////////
+
+#define PHOENIX_PERM_SIZE BOOST_PP_SEQ_SIZE(PHOENIX_PERM_SEQ)
+
+#define PHOENIX_M2(_, N, TUPLE) \
+ BOOST_PP_COMMA_IF(N) BOOST_PP_TUPLE_ELEM(PHOENIX_ITERATION, N, TUPLE)
+
+#define PHOENIX_M3(_, N, TUPLE) \
+ BOOST_PP_COMMA_IF(N) BOOST_PP_TUPLE_ELEM(PHOENIX_ITERATION, N, TUPLE) a ## N
+
+#define PHOENIX_PERM_ELEM(N) BOOST_PP_SEQ_ELEM(N, PHOENIX_PERM_SEQ)
+
+#define PHOENIX_PERM_A(N) \
+ BOOST_PP_REPEAT(PHOENIX_ITERATION, PHOENIX_M2, PHOENIX_PERM_ELEM(N))
+
+#define PHOENIX_PERM_A_a(N) \
+ BOOST_PP_REPEAT(PHOENIX_ITERATION, PHOENIX_M3, PHOENIX_PERM_ELEM(N))
+
+#endif

Added: sandbox/SOC/2010/phoenix3/boost/phoenix/support/detail/iterate_undef.hpp
==============================================================================
--- (empty file)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/support/detail/iterate_undef.hpp 2010-06-17 15:25:59 EDT (Thu, 17 Jun 2010)
@@ -0,0 +1,35 @@
+/*==============================================================================
+ Copyright (c) 2010 Thomas Heller
+
+ 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)
+==============================================================================*/
+
+#undef PHOENIX_typename_A
+#undef PHOENIX_typename_A_void
+#undef PHOENIX_A
+#undef PHOENIX_A_a
+#undef PHOENIX_A_ref
+#undef PHOENIX_A_const_ref
+#undef PHOENIX_A_ref_a
+#undef PHOENIX_A_const_ref_a
+#undef PHOENIX_a
+
+#if PHOENIX_IS_ITERATING
+
+#undef PHEONIX_ITERATION
+#undef PHOENIX_PERM_A
+#undef PHOENIX_PERM_A_a
+
+#undef PHOENIX_M0_R
+#undef PHOENIX_M0
+#undef PHOENIX_M1_R_R
+#undef PHOENIX_M1_R
+#undef PHOENIX_M1
+#undef PHOENIX_M2
+#undef PHOENIX_M3
+#undef PHOENIX_PERM_SEQ
+#undef PHOENIX_PERM_SIZE
+#undef PHOENIX_PERM_ELEM
+
+#endif

Modified: sandbox/SOC/2010/phoenix3/boost/phoenix/support/iterate.hpp
==============================================================================
--- sandbox/SOC/2010/phoenix3/boost/phoenix/support/iterate.hpp (original)
+++ sandbox/SOC/2010/phoenix3/boost/phoenix/support/iterate.hpp 2010-06-17 15:25:59 EDT (Thu, 17 Jun 2010)
@@ -8,39 +8,16 @@
 #define PHOENIX_SUPPORT_ITERATE_HPP
 
 #include <boost/preprocessor/iteration/iterate.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
-#include <boost/preprocessor/tuple/elem.hpp>
 
 #define PHOENIX_IS_ITERATING 0
 
+#define PHOENIX_ITERATE_RESULT_OF 1
+#define PHOENIX_ITERATE_OPERATOR 2
+
 #define PHOENIX_ITERATE() \
     <boost/phoenix/support/detail/iterate.hpp>
 
-#define PHOENIX_typename_A(N) BOOST_PP_ENUM_PARAMS(N, typename A)
-
-#define PHOENIX_typename_A_void(N) \
- BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N, typename A, void)
-
-#define PHOENIX_A(N) \
- BOOST_PP_ENUM_PARAMS(N, A)
-
-#define PHOENIX_A_ref(N) \
- BOOST_PP_ENUM_BINARY_PARAMS(N, A, & BOOST_PP_INTERCEPT)
-
-#define PHOENIX_A_const_ref(N) \
- BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& BOOST_PP_INTERCEPT)
-
-#define PHOENIX_A_a(N) BOOST_PP_ENUM_BINARY_PARAMS(N, A, a)
-
-#define PHOENIX_A_ref_a(N) BOOST_PP_ENUM_BINARY_PARAMS(N, A, & a)
-
-#define PHOENIX_A_const_ref_a(N) \
- BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a)
-
-#define PHOENIX_a(N) \
- BOOST_PP_ENUM_PARAMS(N, a)
+#include <boost/phoenix/support/detail/iterate_define.hpp>
 
 #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