Boost logo

Boost Users :

Subject: Re: [Boost-users] [proto] I'm lost
From: Maurizio Vitale (maurizio.vitale_at_[hidden])
Date: 2009-08-28 16:45:10


Thanks a lot for your reply.

>>>>> "Eric" == Eric Niebler <eric_at_[hidden]> writes:

    Eric> Mail Delivery System wrote:
>> I need a transform property_b that evaluates another transform
>> property_a and returns what property_a returns+1. Simple enough,
>> here's what I do:
>>
>> struct property_a : proto::or_< proto::when< proto::terminal<_>,
>> mpl::int_<42>()> > {};
>>
>> struct property_b : proto::or_ < proto::when< _,
>> mpl::next<property_a(_) >() > > {};

    Eric> proto::or_ in these two is unnecessary. For that matter, so is
    Eric> "(_)" in property_b.

the proto::or_ is because I wanted to change as little as possible from
my real code. The (_) is one of my many attempts to make this thing
compile. I'll gladly take it out.

    Eric> struct actual_width_transform : proto::when<_,
    Eric> mpl::next<left_bound_transform>()> {};

Yep, this was it. Don't know when I dropped the when<> part in my
attempts to that transform...

    Eric> You also appear to have gotten your terminology mixed up, and
    Eric> I think that's contributing to your confusion. You're calling
    Eric> these things "_transform", but they're actually grammars with
    Eric> nested transforms.

...it is the way I think of them. For me a grammar with embedded whens and
transforms is a transform itself in the sense that you can evaluate
grammar () (expression) and you get the corresponding transformed
expression. But I see what you mean.

    Eric> Hope that clears things up.

It does. Thanks

   Maurizio

-- 

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net