Boost logo

Proto :

Subject: Re: [proto] Using make_expr with as_child or as_expr
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2011-05-01 09:39:30


On 01/05/11 04:41, Eric Niebler wrote:
>> In some cases, I really want to write something like
>>
>> proto::make_expr(
>> proto::as_child(a0),
>> proto::as_child(a1)
>> )
>>
>> but that kind of thing doesn't work, due to the funny way make_expr works.
> It doesn't work? I *think* that would have the effect of building a new
> node that would store children by value, making a0 and a1 expressions
> (if they weren't already) by storing the terminal by reference. Is that
> not what you were expecting? What are you trying to do?

We were expecting exactly that. It turned up something is still kept by
reference and cause
the code to crash due to dandling references. If you say it should work,
we may have fumbled
elsewhere. We'll try to get a repro out of nt2.


Proto list run by eric at boostpro.com