Boost logo

Proto :

Subject: Re: [proto] Flags expression as being "top level"
From: Eric Niebler (eric_at_[hidden])
Date: 2011-04-05 00:20:45

On 4/3/2011 10:29 PM, Joel Falcou wrote:
> Hello,
> we need a way to know if a given expression is the "top level" one.
> The use case is to detect the last = in expression like:
> a = b = c = x * y;
> A working but runtime version is given as :
> Havign this feature at compiel time sounds a lot better. I think it
> requires to
> have a expression type carrying a bool_ in its type. Thus in the generator,
> we set this bool_ to false_ in incoming expression and put it back into the
> newly generated expression.
> Is this a correct way of doing this or is there somethign already in
> proto we missed ?

There's nothing in Proto to make this easy. Fiddling with the generator
like you suggest is the first thing I'd try.

(Sorry for the delay. I've been offline for a bit.)

Eric Niebler
BoostPro Computing

Proto list run by eric at