Difference between templates and two separate classes
Templates are essentially a mechanism for source code generation, before the code is compiled.
The two approaches are identical from the perspective of code generation or executable size (except in the first case both classes get a member variable a
, and in the second a
and c
).
Compare variant 1 with variant 2. Notice identical generated code.