Subject: Re: [boost] [proto] small breaking change
From: Eric Niebler (eric_at_[hidden])
Date: 2010-06-09 09:35:16
On 6/9/2010 8:54 AM, joel falcou wrote:
> Eric Niebler wrote:
>> I'll add one. Can you say why you want it?
> I think I may have missed soem details but basically I need my
> expression to overload assignment to generate a expr<assign,..>
> or is inheritng from basic_expr AND use BOOST_PROTO_EXTENDS_ASSIGN
> enough to get it back ?
You typically don't inherit from Proto's expression types; you use
proto::extends or BOOST_PROTO_(BASIC_)EXTENDS. And if you do that, then
the Proto expression you're extending is just a tuple data member that
holds the child nodes. It doesn't need any fancy member functions.
If you're using proto::extends or BOOST_PROTO_EXTENDS (or
BOOST_PROTO_BASIC_EXTENDS with BOOST_PROTO_EXTENDS_ASSIGN), then you'll
have the right overloaded assignment operator regardless of whether
you're extending expr or basic_expr.
-- Eric Niebler BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk