Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-12-03 00:14:19


Author: eric_niebler
Date: 2007-12-03 00:14:18 EST (Mon, 03 Dec 2007)
New Revision: 41632
URL: http://svn.boost.org/trac/boost/changeset/41632

Log:
temporary hack for is_transform
Text files modified:
   branches/proto/v3/boost/xpressive/detail/static/grammar.hpp | 6 +++---
   branches/proto/v3/boost/xpressive/proto/transform/when.hpp | 35 +++++++++++++++++++++++++++++++++--
   2 files changed, 36 insertions(+), 5 deletions(-)

Modified: branches/proto/v3/boost/xpressive/detail/static/grammar.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/detail/static/grammar.hpp (original)
+++ branches/proto/v3/boost/xpressive/detail/static/grammar.hpp 2007-12-03 00:14:18 EST (Mon, 03 Dec 2007)
@@ -324,12 +324,12 @@
         // matches expressions like (set= 'a','b','c')
         // calculates the size of the set
         // populates an array of characters
- template<typename Char>
+ template<typename Char, typename Dummy = transform_base>
         struct ListSet
           : or_<
                 when<
                     comma<ListSet<Char>, CharLiteral<Char> >
- , mpl::next<call<ListSet<Char>(_left)> >()
+ , mpl::next<ListSet<Char>(_left)>()
>
               , when<
                     assign<terminal<set_initializer>, CharLiteral<Char> >
@@ -608,7 +608,7 @@
             struct as_list_set
               : call<
                     fill_list_set(
- set_matcher<traits(_visitor), call<ListSet<Char> > >()
+ set_matcher<traits(_visitor), ListSet<Char> >()
                       , _
                       , _visitor
                     )

Modified: branches/proto/v3/boost/xpressive/proto/transform/when.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/transform/when.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/transform/when.hpp 2007-12-03 00:14:18 EST (Mon, 03 Dec 2007)
@@ -31,6 +31,38 @@
 
     namespace detail
     {
+ template<typename... Args>
+ struct back;
+
+ template<typename A0>
+ struct back<A0>
+ {
+ typedef A0 type;
+ };
+
+ template<typename A0, typename A1>
+ struct back<A0, A1>
+ {
+ typedef A1 type;
+ };
+
+ template<typename A0, typename A1, typename A2>
+ struct back<A0, A1, A2>
+ {
+ typedef A2 type;
+ };
+
+ template<typename A0, typename A1, typename A2, typename A3>
+ struct back<A0, A1, A2, A3>
+ {
+ typedef A3 type;
+ };
+
+ template<typename A0, typename A1, typename A2, typename A3, typename... Rest>
+ struct back<A0, A1, A2, A3, Rest...>
+ : back<Rest...>
+ {};
+
         template<typename T, typename EnableIf = void>
         struct is_transform2_
           : mpl::false_
@@ -48,7 +80,7 @@
 
         template<template<typename...> class T, typename... Args>
         struct is_transform_<T<Args...> >
- : mpl::false_
+ : is_same<typename back<Args...>::type, transform_base>
         {};
     }
 
@@ -67,7 +99,6 @@
     {
         namespace detail
         {
- // can't this apply template be always used? What is the purpose of the one below?
             template<
                 typename Expr
               , typename State


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