Question:
How do I create a template library so that I can export templates and use them in different programs?
Answer:
I’m not sure I understand what you mean by “export templates.” You can either create a collection of .cpp files, each containing a definition (not just a declaration!) of a template, and #include it in every program that uses this template.
There is another way of doing it?namely, using the export keyword. However, at present, I don’t know of any compiler that supports this feature; so, practically, there is only one way to reuse templates?the one described above.