I have a templated class, and I want to only allow certain types to be used. I believe one way to do this is to use explicit instantiation at the end of the source file -- I believe this will cause linker errors if the developer tried to instantiate a type that is not one of the explicitly instantiated types.
However, when I searched on SO, e.g., in the 2 links below, I did not see any mentioning of using explicit instantiation, so I am questioning if explicit instantiation shoudl be used for this.
Could someone advise?