
23 Feb
2005
23 Feb
'05
2 p.m.
documentation, but just for completeness. Given a type trait TT which you want to select upon. Given a template function TF which you would like to call only for types that TT selects from within template function G. We need a type which will delegate to TF, that doesn't bind the template parameter types and is a first class type (a holder) template <typename T> void TF(T) {} struct TF_holder { typedef void result_type; template <typename T> result_type invoke(T t) {return TF(t);} }; template <typename U> void G(U u) { execute_if< TT< U
::invoke< TF_holder >(u); }
G is the generic template function for all types, TF is the conditionally targeted template function for types for which TT is true. Hope that helps. Jeff Mirwaisi