A
Aaron Graham
template <typename T> struct foo { ... };
typedef boost::mpl::vector<A, B, C, D, E, F> my_types;
I would like to explicitly instantiate foo<T> for all types in
my_types. Those are all the types that foo<T> will ever be used with,
and the surrounding metaprogramming is large and complex enough that I
don't want to put it all in a header file.
So I want to metaprogram the equivalent of:
template class foo<A>;
template class foo<B>;
template class foo<C>;
....etc...
The current solution I have is a function that calls mpl::for_each on
the vector of types, but that actually generates unnecessary code that
never needs to be called, which I find rather ugly.
typedef boost::mpl::vector<A, B, C, D, E, F> my_types;
I would like to explicitly instantiate foo<T> for all types in
my_types. Those are all the types that foo<T> will ever be used with,
and the surrounding metaprogramming is large and complex enough that I
don't want to put it all in a header file.
So I want to metaprogram the equivalent of:
template class foo<A>;
template class foo<B>;
template class foo<C>;
....etc...
The current solution I have is a function that calls mpl::for_each on
the vector of types, but that actually generates unnecessary code that
never needs to be called, which I find rather ugly.