Boost logo

Proto :

Subject: Re: [proto] pod_generator Question
From: Eric Niebler (eric_at_[hidden])
Date: 2011-02-12 05:41:06


On 2/12/2011 7:17 AM, Nate Knight wrote:
> I see in the Proto documentation a trick for getting the Proto operator overloads found by ADL using something like
>
> template<class T, class Dummy = proto::is_proto_expr>
> struct my_complex
> {
> BOOST_PROTO_EXTENDS(
> typename proto::terminal<std::complex<T> >::type
> , my_complex<T>
> , proto::default_domain
> )
> };
>
> The proto::pod_generator class template, however, expects its argument to be a one argument class template.
> So, something like
>
> struct my_domain : proto::domain< proto::pod_generator< my_complex> > {};
>
> won't work because my_complex is a two argument class template (even though its got one default argument).

It wouldn't work anyway because pod_generator expects that it's
argument's template parameter is a Proto expression. my_complex's
template argument is (presumably) a scalar. Generators are for wrapping
bare expressions in custom wrappers. my_complex is already a wrapped
Proto expression.

> Is there some work around for this, am I missing something, or am I out of luck.

If I had a better idea of what you were trying to do, I could help.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Proto list run by eric at boostpro.com