
11 Sep
2013
11 Sep
'13
11:01 p.m.
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