Boost logo

Boost :

Subject: Re: [boost] proposal for metafunction mpl::eval
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2013-09-11 19:01:04


>>> I'm not so much into meta-programming, so I'm not sure whether >>> there's already an alternative available. >>> >>> Nevertheless I'd like to propose a new metafunction that simply >>> evaluates its argument: >>> >>> template<typename F> >>> struct eval: F::type >>> {}; >> >> 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 to get at the type (rather than just eval<F>), which is no better than typename F::type Regards, Nate


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