Re: [proto] vararg + fold

2010-07-21 Thread Eric Niebler
On 7/21/2010 3:51 PM, Christophe Henry wrote: >> I was getting my A's and B's mixed up, and you're getting your A's and >> trees mixed up. What you want is: >> >> struct B >> : or_< >>when< comma< B, B >, fold_tree<..as before..> > >> , when< A, mpl::vector1() > >>> >> {}; > > Ar

Re: [proto] vararg + fold

2010-07-21 Thread Christophe Henry
> I was getting my A's and B's mixed up, and you're getting your A's and > trees mixed up. What you want is: > > struct B > : or_< >when< comma< B, B >, fold_tree<..as before..> > > , when< A, mpl::vector1() > >> > {}; Argh!!! *Grumble* *Grumble* This is exactly the first solutio

Re: [proto] vararg + fold

2010-07-21 Thread Eric Niebler
On 7/21/2010 9:02 AM, Christophe Henry wrote: >>> template >>> struct make_vector >>> { >>> typedef boost::mpl::vector type; >>> }; >>> >>> struct B >>>: proto::or_< >>> proto::when < >>> A, >>> make_vector() > >> You could simply use mpl::v

Re: [proto] vararg + fold

2010-07-21 Thread Christophe Henry
>> template >> struct make_vector >> { >> typedef boost::mpl::vector type; >> }; >> >> struct B >>: proto::or_< >> proto::when < >> A, >> make_vector() >You could simply use mpl::vector1() and not bother with >make_vector. Indeed. I tried w

Re: [proto] vararg + fold

2010-07-21 Thread Eric Niebler
On 7/21/2010 7:43 AM, Christophe Henry wrote: > Hi, > > I want a grammar B which parses a comma-separated list of expressions > matching another grammar A and returning a mpl::vector of expressions > transformed using A. Something like: > (AExpr, AExpr, ...). > > I managed to do it this way: > >