Boost logo

Boost :

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>

etc... So,

apply_if<some_condition,some_type_1,plus<some_type_2::type,some_number >



Assuming some_number evaluates to its self, or if not,

umber> > >::type;


Boost list run by bdawes at, gregod at, cpdaniel at, john at