I am part of a small project that is doing some research code in C++.
Our work involves a lot of mathematics and due to its nature we often need to temporarily use other people's code/libraries. To speed our own iteration times we designed a template based interface that allows to treat almost any vector type, e.g.
glm::vec4... As if they were the same, this is fantastic for prototyping and making demos (which is what our needs are), since you don;t need to explicitly write down conversion code between one math implementation to another.
We are however running into the problem of really long compile times. It takes about 2 minutes at the moment to compile a file with a few hundred lines of code, and we are starting to loose some of the advantages of the template strategy (fast iteration).
Are there tricks we could use to speed up compilation without outright re-implementing everything without templates? (which is likely to bloat the codebase significantly). We already tried template instanciation, but since our types are often dissimilar and not known beforehand it's not helping much.