3 ms·
But there's no .cpp file for many (most?) uses of templates.
by creata 3y ago
But there's no .cpp file for many (most?) uses of templates.
- meindnoch 3y agoIf you think about what templates are, it's not hard to understand why they must go completely in the header files. It's literally a source code template. It's a set of instructions to generate code at compile time, depending on the template parameters, hence 100% of the source code must be available at the point of instantiation. Just the interface is not enough.
- creata 3y agoOf course, but it still breaks the split between interface and implementation that people are talking about here.