Generally, I would use boost::mpl::for_each<>()
to traverse a boost::mpl::vector
, but this requires a functor with a template function declared like the following:
template<typename T> void operator()(T&){T::staticCall();}
My problem with this is that I don't want the object T to be instantiated by for_each<>
. I don't need the T parameter in the operator()
at all. Is there a way to accomplish this, or an alternative to for_each<>
that doesn't pass an object of type T to the template function?
Optimally, I would like the operator() definition to look like this:
template<typename T> void operator()(){T::staticCall();}
And of course, I don't want T to be instantiated at all prior to the call. Any other tips/suggestions are also welcome.