— Based on P154 [[pro .net performance]] —
A regular c++ class Dog has 2 forms i.e. source file and the compiled binary file (usually as a library).
In contrast, a c++ class template like a simple BigList has 1 form only. There’s no such thing as a compiled form of a class template (unlike java/c#). The BigList source is used only when we compile a concretized class based on the template, such as BigList. If we include BigList source in a project but never use it, then the compiler probably ignores it.
If BigList defines a method dance() that’s not used in BigList, then this method is ignored by the compiler. In contrast, an invoked method (such as add()) is “expanded” with the type-argument “string”, to become a concretized method, and then compiled. I feel the expansion mechanism is similar to macro expansion.
What if dance() contains something unsupported by string? Well, rest assured — not compiled.
In C#, BigList is not an “expanded” or concretized version of BigList.