From: Richard Crossley (rdc_at_[hidden])
Date: 2002-09-19 05:32:15
> I can certainly acknowledge that. In fact, I've suggested
> that all metafunctions evaluate their own arguments.
> [Addition: I see you suggest the same below here. :) ]
> Similar to how apply_if evaluates the selected argument, as you say.
How would this work with, for example the traits classes, assuming that
for consistency they also evaluate their arguments? Would we now have to
write remove_pointer<identity<char*> >::type or would the traits classes
be specialised in some way for the built in types?
Personally I 'get around the problem' with an additional template:
template <typename T>
struct eva; // evaluate arguments
template <template <typename> class F,typename A0>
struct eva<F<A0> > : F<typename A0::type>
template <template <typename,typename> class F,typename A0,typename A1>
struct eva<F<A0,A1> > : F<typename A0::type,typename A1::type>
Assuming some_number evaluates to its self, or if not,
umber> > >::type;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk