Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] Accessing nary_expr tag in transform
From: Eric Niebler (eric_at_[hidden])
Date: 2008-11-25 09:51:27

Joel Falcou wrote:
> I have a nary_expr grammar rule and in its associated tranform, I want
> to retrieves the actual tag.
> when< nary_expr<_ , bp::vararg<my_grammar> >
> , some_transform_using_the_tag(bp::_tag)
> >
> obviously proto::_tag doesn't exist.
> How can I retrieve this information ?

Well, there isn't a tag object, just a tag type. To get the tag's type
in a transform, you can use proto::tag_of<_>. If you want a
default-constructed object of that type, use proto::tag_of<_>().


Eric Niebler
BoostPro Computing

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at