I am helping with some effort of improving the build speed of a big c++ project.
One of the issues is that different set of includes my result in different execution code if template specializations are involved - based on if they are visible or not.
I am trying to create a practice (rule) that will prevent such issues.
The rule I am having right now is:
Template specialization has to be either in the same header file with the template or in the header of one of the types involved in the specialization.
This seems to me that it will be sufficient to make sure that if specialization is usable - it will be always visible whatever subset of headers are included.
My question is - do you see any flaw in such rule?