Boost logo

Boost :

Subject: Re: [boost] proposal for metafunction mpl::eval
From: klaus triendl (klaus_at_[hidden])
Date: 2013-09-12 03:15:18


Am Wed, 11 Sep 2013 23:01:04 +0000
schrieb Nathan Ridge <zeratul976_at_[hidden]>:

> >> You can only derive from class types, so this can't be used with
> >> metafunctions returning scalar types, references, pointers,
> >> arrays, or functions.
> >
> > I'm aware of this, however the implementation could be different:
> >
> > template<typename F>
> > struct eval
> > {
> > typedef typename F::type type;
> > }
>
> This is now a different metafunction - you have to write
>
> typename eval<F>::type

You're damn right!

However I don't see a practical problem here:
Regarding my motivating case, eval_if anyway expects an integral
constant as its evaluation condition, therefore F must yield an integral
constant.

Regards,
klaus


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