|
Boost Users : |
Subject: Re: [Boost-users] [proto] Can't use template domain class with BOOST_PROTO_BASIC_EXTENDS
From: Eric Niebler (eric_at_[hidden])
Date: 2010-10-09 15:15:21
On 10/9/2010 12:02 PM, joel falcou wrote:
> Trying to use template domain class with BOOST_PROTO_BASIC_EXTENDS
> ends up in an error leading to the fact this ligne in the macro is
> incorrect when the Domain is template:
>
> BOOST_PROTO_BASIC_EXTENDS_(Expr, Derived, Domain)
> typedef void proto_is_aggregate_;
> typedef Domain::proto_generator proto_generator;
>
> Obviously this is alckign a typename before Domain::proto_generator if
> Domain is actually a template class.
You mean, if Domain is a template parameter. Crap.
> Thing is used to work before ( aorund 1.40) so I guess somethign changed
> around here.
> I guess a details meta-function extracting the domain will fix that or
> am I wrong ?
>
> namespace boost { namespace proto
> {
> template<class Domain> generator_of
> {
> typedef typename Domain::proto_generator type;
> };
> } }
>
> BOOST_PROTO_BASIC_EXTENDS_(Expr, Derived, Domain)
> typedef void proto_is_aggregate_;
> typedef typename generator_of<Domain>::type proto_generator;
>
> Or is it ?
That doesn't help. The "typename" would be incorrect (in C++03) if
Domain is not a template parameter. Sometimes I really love C++. This is
not one of those times.
I think I need to add (and test and document) a whole other collection
of macros to support this corner case. Grrrr...
Please file a bug. Thanks,
-- Eric Niebler BoostPro Computing http://www.boostpro.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net