I'm looking for a compiler option on g++/clang++ to control the instantiation of methods in explicit instantiations.
Suppose I have a classtemplate Foo<T>
with some explicit instantiation
template Foo<int>;
I want to enable the instantiation of all public methods. This doesn't seem to be the default, as I'm having to add manual instantiations for all the members in order to avoid link errors;
template void Foo<int>:DoStuff(int);
template int Foo<int>:GetSomeStuff();