Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2007-06-15 01:37:23


Maurizio Vitale wrote:
> Eric,
> I've found more about the root problem in my code. A pattern for a terminal was not matching and
> the thus the transform for unary_expr was applied.
>
> In the code included, I define a class, K_aux, which inherits from meta_expression<typename proto::terminal<K<mpl::int_<N> >,
> Normally, objects of type K_aux match a pattern terminal<K<proto::_> >. I'm still fuzzy on why two layers of the type are
> skipped, but I'm fine with it.
>
> Now, if K_aux defines a type named type (e.g. effectively becoming a nullary metafunction) the pattern doesn't match anymore.

Yep, I've known about this gotcha for a while and have been meaning to
fix it before anybody noticed, but you beat me to it. :-P Proto uses the
nested type named "type" to mean "the type of this expression", which
was fine before proto::extends<> existed, but is dangerous and stupid
once people start extending expression types. I'm sorry. Basically, I
need to change all the nested types that Proto accesses to be
proto-specific. So "type" becomes "proto_type", "tag_type" becomes
"proto_tag", and even "arg0_type" becomes "proto_arg0", etc. This is a
major breaking change, but it has to be done, and the sooner the better.
Darn.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com
The Astoria Seminar ==> http://www.astoriaseminar.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk