Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-12-21 16:25:10


Author: eric_niebler
Date: 2007-12-21 16:25:10 EST (Fri, 21 Dec 2007)
New Revision: 42235
URL: http://svn.boost.org/trac/boost/changeset/42235

Log:
first attempt at porting matches<> to c++03 (largely untested)
Text files modified:
   branches/proto/v3/boost/xpressive/proto/args.hpp | 2
   branches/proto/v3/boost/xpressive/proto/matches.hpp | 346 ++++++++++++++++++++++++++++++++++-----
   branches/proto/v3/boost/xpressive/proto/proto_fwd.hpp | 14 -
   branches/proto/v3/boost/xpressive/proto/transform/arg.hpp | 24 --
   branches/proto/v3/boost/xpressive/proto/transform/fold.hpp | 20 --
   branches/proto/v3/boost/xpressive/proto/transform/fold_tree.hpp | 10 -
   branches/proto/v3/boost/xpressive/proto/transform/make.hpp | 25 --
   7 files changed, 306 insertions(+), 135 deletions(-)

Modified: branches/proto/v3/boost/xpressive/proto/args.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/args.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/args.hpp 2007-12-21 16:25:10 EST (Fri, 21 Dec 2007)
@@ -58,7 +58,7 @@
         #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, BOOST_PROTO_MAX_ARITY, <boost/xpressive/proto/args.hpp>))
         #include BOOST_PP_ITERATE()
 
- #if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
+ #ifdef BOOST_HAS_VARIADIC_TMPL
             template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename A), typename... Args>
             struct args< BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, A), Args... >
             {

Modified: branches/proto/v3/boost/xpressive/proto/matches.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/matches.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/matches.hpp 2007-12-21 16:25:10 EST (Fri, 21 Dec 2007)
@@ -45,6 +45,7 @@
             template<typename Expr, typename Grammar>
             struct matches_;
 
+ #ifdef BOOST_HAS_VARIADIC_TMPL
             template<bool Head, typename... Preds>
             struct and_
               : mpl::bool_<Head>
@@ -59,21 +60,22 @@
             struct and_<true, Head>
               : Head
             {};
-
- template<bool Head, typename... Preds>
- struct or_
+ #else
+ template<bool Head, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename A, void)>
+ struct and_
               : mpl::bool_<Head>
             {};
 
- template<typename Head, typename... Preds>
- struct or_<false, Head, Preds...>
- : or_<Head::value, Preds...>
+ template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename A)>
+ struct and_<true BOOST_PP_ENUM_TRAILING_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, A)>
+ : and_<A0::value, BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, A)>
             {};
 
- template<typename Head>
- struct or_<false, Head>
- : Head
+ template<>
+ struct and_<true>
+ : mpl::true_
             {};
+ #endif
 
             template<typename T, typename U>
             struct array_matches
@@ -105,6 +107,7 @@
               : mpl::false_
             {};
 
+ #ifdef BOOST_HAS_VARIADIC_TMPL
             template<
                 template<typename, typename...> class T
               , typename E0, typename... ET
@@ -116,6 +119,25 @@
                   , lambda_matches<ET, GT>...
>
             {};
+ #else
+ #define TMP0(Z, N, DATA) , lambda_matches<BOOST_PP_CAT(E, N), BOOST_PP_CAT(G, N)>
+ #define TMP1(Z, N, DATA) \
+ template< \
+ template<BOOST_PP_ENUM_PARAMS_Z(Z, N, typename BOOST_PP_INTERCEPT)> class T \
+ , BOOST_PP_ENUM_PARAMS_Z(Z, N, typename E) \
+ , BOOST_PP_ENUM_PARAMS_Z(Z, N, typename G) \
+ > \
+ struct lambda_matches_aux_<T<BOOST_PP_ENUM_PARAMS_Z(Z, N, E)>, T<BOOST_PP_ENUM_PARAMS_Z(Z, N, G)> >\
+ : and_< \
+ lambda_matches<E0, G0>::value \
+ BOOST_PP_REPEAT_ ## Z(N, TMP0, ~) \
+ > \
+ {}; \
+ /**/
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), TMP1, ~)
+ #undef TMP0
+ #undef TMP1
+ #endif
 
             template<typename T, typename U BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(long Arity)>
             struct lambda_matches
@@ -214,6 +236,17 @@
             template<bool True, typename Cons1, typename Cons2>
             struct nonterminal_matches;
 
+ template<typename Cons1, typename Cons2>
+ struct nonterminal_matches<false, Cons1, Cons2>
+ : mpl::false_
+ {};
+
+ template<>
+ struct nonterminal_matches<true, args<>, args<> >
+ : mpl::true_
+ {};
+
+ #ifdef BOOST_HAS_VARIADIC_TMPL
             template<typename Head1, typename... Tail1, typename Head2, typename... Tail2>
             struct nonterminal_matches<true, args<Head1, Tail1...>, args<Head2, Tail2...> >
               : nonterminal_matches<
@@ -225,16 +258,26 @@
                   , args<Tail2...>
>
             {};
-
- template<typename Cons1, typename Cons2>
- struct nonterminal_matches<false, Cons1, Cons2>
- : mpl::false_
- {};
-
- template<>
- struct nonterminal_matches<true, args<>, args<> >
- : mpl::true_
+ #else
+ template<
+ BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename E)
+ , BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename G)
+ >
+ struct nonterminal_matches<
+ true
+ , args<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, E)>
+ , args<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, G)>
+ >
+ : nonterminal_matches<
+ matches_<
+ UNREF(E0)::proto_base_expr
+ , UNREF(G0)::proto_base_expr
+ >::value
+ , args<BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_ARITY, E)>
+ , args<BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_ARITY, G)>
+ >
             {};
+ #endif
 
             template<
                 typename Args1
@@ -245,6 +288,12 @@
               : mpl::false_
             {};
 
+ template<typename Head2>
+ struct vararg_matches<args<>, args<Head2>, true>
+ : mpl::true_
+ {};
+
+ #ifdef BOOST_HAS_VARIADIC_TMPL
             template<typename Head1, typename... Tail1, typename Head2, typename... Tail2>
             struct vararg_matches<args<Head1, Tail1...>, args<Head2, Tail2...>, true>
               : and_<
@@ -274,11 +323,51 @@
>
>
             {};
+ #else
+ template<
+ BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename E)
+ , BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename G)
+ >
+ struct vararg_matches<
+ args<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, E)>
+ , args<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, G)>
+ , true
+ >
+ : and_<
+ matches_<
+ UNREF(E0)::proto_base_expr
+ , UNREF(G0)::proto_base_expr
+ >::value
+ , vararg_matches<
+ args<BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_ARITY, E)>
+ , args<BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_ARITY, G)>
+ , true
+ >
+ >
+ {};
 
- template<typename Head2>
- struct vararg_matches<args<>, args<Head2>, true>
- : mpl::true_
+ template<
+ BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename E)
+ , typename G0
+ >
+ struct vararg_matches<
+ args<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, E)>
+ , args<G0>
+ , true
+ >
+ : and_<
+ matches_<
+ UNREF(E0)::proto_base_expr
+ , UNREF(G0)::proto_base_expr
+ >::value
+ , vararg_matches<
+ args<BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_ARITY, E)>
+ , args<G0>
+ , true
+ >
+ >
             {};
+ #endif
 
             template<typename Expr, typename Grammar>
             struct matches_
@@ -290,6 +379,7 @@
               : mpl::true_
             {};
 
+ #ifdef BOOST_HAS_VARIADIC_TMPL
             template<
                 typename Tag1
               , typename Head1
@@ -327,6 +417,38 @@
                   , args<Tail2...>
>
             {};
+ #else
+ template<typename Args1, typename Args2>
+ struct nonterminal_matches_aux;
+
+ template<
+ BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename E)
+ , BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, typename G)
+ >
+ struct nonterminal_matches_aux<
+ args<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, E)>
+ , args<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_ARITY, G)>
+ >
+ : nonterminal_matches<
+ matches_<
+ UNREF(E0)::proto_base_expr
+ , UNREF(G0)::proto_base_expr
+ >::value
+ , args<BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_ARITY, E)>
+ , args<BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_ARITY, G)>
+ >
+ {};
+
+ template<typename Tag1, typename Args1, long N, typename Args2>
+ struct matches_<expr<Tag1, Args1, N>, expr<Tag1, Args2, N> >
+ : nonterminal_matches_aux<Args1, Args2>
+ {};
+
+ template<typename Tag1, typename Args1, long N, typename Args2>
+ struct matches_<expr<Tag1, Args1, N>, expr<_, Args2, N> >
+ : nonterminal_matches_aux<Args1, Args2>
+ {};
+ #endif
 
             template<typename Arg1, typename Arg2>
             struct matches_<expr<tag::terminal, term<Arg1>, 0>, expr<tag::terminal, term<Arg2>, 0> >
@@ -336,42 +458,145 @@
             template<typename Tag1, typename Args1, long N1, typename Args2, long N2>
             struct matches_<expr<Tag1, Args1, N1>, expr<Tag1, Args2, N2> >
               : vararg_matches<Args1, Args2>
- {};
+ {
+ BOOST_MPL_ASSERT_RELATION(N1, !=, N2);
+ };
 
             template<typename Tag1, typename Args1, long N1, typename Args2, long N2>
             struct matches_<expr<Tag1, Args1, N1>, expr<_, Args2, N2> >
               : vararg_matches<Args1, Args2>
+ {
+ BOOST_MPL_ASSERT_RELATION(N1, !=, N2);
+ };
+
+ #ifdef BOOST_HAS_VARIADIC_TMPL
+ template<bool Head, typename Expr, typename... G>
+ struct or_matches_
+ : mpl::false_
             {};
 
+ template<typename Expr, typename G0, typename G1, typename... Rest>
+ struct or_matches_<false, Expr, G0, G1, Rest...>
+ : or_matches_<matches_<Expr, typename G1::proto_base_expr>::value, Expr, G1, Rest...>
+ {};
+
+ template<typename Expr, typename G0, typename... Rest>
+ struct or_matches_<true, Expr, G0, Rest...>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+
             // handle proto::or_
             template<typename Expr, typename Head, typename... Tail>
             struct matches_<Expr, proto::or_<Head, Tail...> >
- : or_<
+ : or_matches_<
                     matches_<
                         typename Expr::proto_base_expr
                       , typename Head::proto_base_expr
>::value
- , matches_<
- typename Expr::proto_base_expr
- , typename Tail::proto_base_expr
- >...
+ , typename Expr::proto_base_expr
+ , Head
+ , Tail...
>
             {};
 
+ template<bool Head, typename Expr, typename... G>
+ struct and_matches_
+ : mpl::true_
+ {};
+
+ template<typename Expr, typename G0, typename G1, typename... Rest>
+ struct and_matches_<true, Expr, G0, G1, Rest...>
+ : and_matches_<matches_<Expr, typename G1::proto_base_expr>::value, Expr, G1, Rest...>
+ {};
+
+ template<typename Expr, typename G0, typename... Rest>
+ struct and_matches_<false, Expr, G0, Rest...>
+ : mpl::false_
+ {};
+
             // handle proto::and_
             template<typename Expr, typename Head, typename... Tail>
             struct matches_<Expr, proto::and_<Head, Tail...> >
- : and_<
+ : and_matches_<
                     matches_<
                         typename Expr::proto_base_expr
                       , typename Head::proto_base_expr
>::value
- , matches_<
+ , typename Expr::proto_base_expr
+ , Head
+ , Tail...
+ >
+ {};
+
+ #else
+ template<bool Head, typename Expr, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)>
+ struct or_matches_
+ : or_matches_<
+ matches_<Expr, typename G1::proto_base_expr>::value
+ , Expr
+ , BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)
+ >
+ {};
+
+ template<typename Expr, BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
+ struct or_matches_<true, Expr, BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)>
+ : mpl::true_
+ {
+ typedef G0 which;
+ };
+
+ template<typename Expr, typename G0>
+ struct or_matches_<false, Expr, G0>
+ : mpl::false_
+ {};
+
+ // handle proto::or_
+ template<typename Expr, BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
+ struct matches_<Expr, proto::or_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
+ : or_matches_<
+ matches_<
+ typename Expr::proto_base_expr
+ , typename G0::proto_base_expr
+ >::value
+ , typename Expr::proto_base_expr
+ , BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)
+ >
+ {};
+
+ template<bool Head, typename Expr, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)>
+ struct and_matches_
+ : and_matches_<
+ matches_<Expr, typename G1::proto_base_expr>::value
+ , Expr
+ , BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)
+ >
+ {};
+
+ template<typename Expr, BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
+ struct and_matches_<false, Expr, BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)>
+ : mpl::false_
+ {};
+
+ template<typename Expr, typename G0>
+ struct and_matches_<true, Expr, G0>
+ : mpl::true_
+ {};
+
+ // handle proto::and_
+ template<typename Expr, BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
+ struct matches_<Expr, proto::and_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
+ : and_matches_<
+ matches_<
                         typename Expr::proto_base_expr
- , typename Tail::proto_base_expr
- >...
+ , typename G0::proto_base_expr
+ >::value
+ , typename Expr::proto_base_expr
+ , BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)
>
             {};
+ #endif
 
             // handle proto::if_
             template<typename Expr, typename If, typename Then, typename Else>
@@ -433,21 +658,29 @@
               : mpl::true_
             {};
 
- template<typename Expr, typename... Alts>
- struct which;
-
- template<typename Expr, typename Head, typename... Tail>
- struct which<Expr, Head, Tail...>
- : mpl::if_<
- matches<Expr, Head>
- , mpl::identity<Head>
- , which<Expr, Tail...>
- >::type
- {};
-
+ #ifndef BOOST_HAS_VARIADIC_TMPL
+ template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)>
+ struct back_
+ {
+ typedef BOOST_PP_CAT(G, BOOST_PP_DEC(BOOST_PROTO_MAX_LOGICAL_ARITY)) type;
+ };
+ #define TMP(Z, N, DATA) \
+ template<BOOST_PP_ENUM_PARAMS_Z(Z, N, typename G)> \
+ struct back_<BOOST_PP_ENUM_PARAMS_Z(Z, N, G)> \
+ { \
+ typedef BOOST_PP_CAT(G, BOOST_PP_DEC(N)) type; \
+ }; \
+ /**/
+ BOOST_PP_REPEAT_FROM_TO(1, BOOST_PROTO_MAX_LOGICAL_ARITY, TMP, ~)
+ #undef TMP
+ #endif
         } // namespace detail
 
+ #ifdef BOOST_HAS_VARIADIC_TMPL
         template<typename... Alts>
+ #else
+ template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
+ #endif
         struct or_ : callable
         {
             typedef or_ proto_base_expr;
@@ -458,25 +691,32 @@
             template<typename This, typename Expr, typename State, typename Visitor>
             struct result<This(Expr, State, Visitor)>
             {
- typedef typename boost::result_of<
- typename detail::which<UNCVREF(Expr), Alts...>::type(Expr, State, Visitor)
- >::type type;
+ typedef typename proto::result_of::detail::matches_<UNCVREF(Expr)::proto_base_expr, or_>::which which;
+ typedef typename boost::result_of<which(Expr, State, Visitor)>::type type;
             };
 
             template<typename Expr, typename State, typename Visitor>
             typename result<or_(Expr const &, State const &, Visitor &)>::type
             operator()(Expr const &expr, State const &state, Visitor &visitor) const
             {
- typedef typename detail::which<Expr, Alts...>::type which;
+ typedef typename proto::result_of::detail::matches_<typename Expr::proto_base_expr, or_>::which which;
                 return which()(expr, state, visitor);
             }
         };
 
+ #ifdef BOOST_HAS_VARIADIC_TMPL
         template<typename... Alts>
         struct and_ : args<Alts...>::back_
         {
             typedef and_ proto_base_expr;
         };
+ #else
+ template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
+ struct and_ : detail::back_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)>::type
+ {
+ typedef and_ proto_base_expr;
+ };
+ #endif
 
         // if_
         template<typename If, typename Then, typename Else>
@@ -557,6 +797,7 @@
 
     }
 
+#ifdef BOOST_HAS_VARIADIC_TMPL
     template<typename... Args>
     struct is_callable<or_<Args...> >
       : mpl::true_
@@ -566,6 +807,17 @@
     struct is_callable<and_<Args...> >
       : mpl::true_
     {};
+#else
+ template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
+ struct is_callable<or_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
+ : mpl::true_
+ {};
+
+ template<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G)>
+ struct is_callable<and_<BOOST_PP_ENUM_PARAMS(BOOST_PROTO_MAX_LOGICAL_ARITY, G)> >
+ : mpl::true_
+ {};
+#endif
 
     template<typename Grammar>
     struct is_callable<not_<Grammar> >

Modified: branches/proto/v3/boost/xpressive/proto/proto_fwd.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/proto_fwd.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/proto_fwd.hpp 2007-12-21 16:25:10 EST (Fri, 21 Dec 2007)
@@ -81,7 +81,7 @@
 
     namespace argsns_
     {
- #if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
+ #ifdef BOOST_HAS_VARIADIC_TMPL
         template<typename... Args>
         struct cons;
 
@@ -291,15 +291,15 @@
 
     #if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
     template<typename T>
- typename result_of::as_expr_ref<T>::type
+ typename result_of::as_expr_ref<T>::type const
     as_expr_ref(T &&t);
     #else
     template<typename T>
- typename result_of::as_expr_ref<T &>::type
+ typename result_of::as_expr_ref<T &>::type const
     as_expr_ref(T &t);
 
     template<typename T>
- typename result_of::as_expr_ref<T const &>::type
+ typename result_of::as_expr_ref<T const &>::type const
     as_expr_ref(T const &t);
     #endif
 
@@ -385,7 +385,7 @@
             struct is_vararg;
         }
 
- #if defined(BOOST_HAS_VARIADIC_TMPL) && defined(BOOST_HAS_RVALUE_REFS)
+ #ifdef BOOST_HAS_VARIADIC_TMPL
         template<typename... Alts>
         struct or_;
 
@@ -528,9 +528,6 @@
         template<int I>
         struct _arg_c;
 
- template<typename T>
- struct always;
-
         struct _arg0;
         struct _arg1;
         struct _arg2;
@@ -570,7 +567,6 @@
     using transform::make;
     using transform::bind;
     using transform::fold;
- using transform::always;
     using transform::reverse_fold;
     using transform::fold_tree;
     using transform::reverse_fold_tree;

Modified: branches/proto/v3/boost/xpressive/proto/transform/arg.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/transform/arg.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/transform/arg.hpp 2007-12-21 16:25:10 EST (Fri, 21 Dec 2007)
@@ -126,32 +126,8 @@
         typedef _arg0 _arg;
         typedef _arg0 _left;
         typedef _arg1 _right;
-
- template<typename T>
- struct always : callable
- {
- template<typename Sig>
- struct result;
-
- template<typename This, typename Expr, typename State, typename Visitor>
- struct result<This(Expr, State, Visitor)>
- {
- typedef T type;
- };
-
- template<typename Expr, typename State, typename Visitor>
- T operator()(Expr const &, State const &, Visitor &) const
- {
- return T();
- }
- };
     }
 
- template<typename T>
- struct is_callable<transform::always<T> >
- : mpl::true_
- {};
-
     template<int I>
     struct is_callable<transform::_arg_c<I> >
       : mpl::true_

Modified: branches/proto/v3/boost/xpressive/proto/transform/fold.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/transform/fold.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/transform/fold.hpp 2007-12-21 16:25:10 EST (Fri, 21 Dec 2007)
@@ -53,24 +53,6 @@
                 Visitor &v_;
             };
 
- struct reverse : callable
- {
- template<typename Sig>
- struct result;
-
- template<typename This, typename T>
- struct result<This(T)>
- : fusion::result_of::reverse<UNREF(T) const>
- {};
-
- template<typename T>
- typename fusion::result_of::reverse<T const>::type
- operator()(T const &t) const
- {
- return fusion::reverse(t);
- }
- };
-
         } // namespace detail
 
         template<typename Sequence, typename State0, typename Fun>
@@ -103,7 +85,7 @@
 
         template<typename Sequence, typename State, typename Fun>
         struct reverse_fold
- : fold<detail::reverse(Sequence), State, Fun>
+ : fold<_reverse(Sequence), State, Fun>
         {};
 
     }

Modified: branches/proto/v3/boost/xpressive/proto/transform/fold_tree.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/transform/fold_tree.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/transform/fold_tree.hpp 2007-12-21 16:25:10 EST (Fri, 21 Dec 2007)
@@ -110,20 +110,10 @@
       : mpl::true_
     {};
 
- template<typename Grammar, typename Fun>
- struct is_callable<transform::detail::fold_tree_<Grammar, Fun> >
- : mpl::true_
- {};
-
     template<typename Sequence, typename State0, typename Fun>
     struct is_callable<transform::reverse_fold_tree<Sequence, State0, Fun> >
       : mpl::true_
     {};
-
- template<typename Grammar, typename Fun>
- struct is_callable<transform::detail::reverse_fold_tree_<Grammar, Fun> >
- : mpl::true_
- {};
 }}
 
 #include <boost/xpressive/proto/detail/undef.hpp>

Modified: branches/proto/v3/boost/xpressive/proto/transform/make.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/transform/make.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/transform/make.hpp 2007-12-21 16:25:10 EST (Fri, 21 Dec 2007)
@@ -99,14 +99,6 @@
>::type>
             {};
 
- //// work around GCC bug
- //template<typename Tag, typename Args, long N, typename Expr, typename State, typename Visitor>
- //struct make_if_<expr<Tag, Args, N>, Expr, State, Visitor, false>
- //{
- // typedef expr<Tag, Args, N> type;
- // typedef void not_applied_;
- //};
-
             template<typename Type, bool IsAggregate = is_aggregate<Type>::value>
             struct construct_
             {
@@ -176,23 +168,6 @@
             }
         };
 
- //// work around gcc bug
- //template<typename T, typename A, long N, typename... Args>
- //struct make<expr<T, A, N>, Args...> : callable
- //{
- // template<typename Sig>
- // struct result
- // {
- // typedef expr<T, A, N> type;
- // };
-
- // template<typename Expr, typename State, typename Visitor>
- // expr<T, A, N> operator()(Expr const &expr, State const &state, Visitor &visitor) const
- // {
- // return proto::expr<T, A, N>::make(when<_, Args>()(expr, state, visitor)...);
- // }
- //};
-
         template<typename Fun, typename... Args>
         struct make<Fun(Args...)>
           : make<Fun, Args...>


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