This comment is true in that the code is compiled once for each instantiation thus increasing compile time. On the other hand Jason is right pointing out that the linker is responsible for eliminating redundant code. If you list the symbols in all compilation units you will see that all template generated code is marked as a weak symbol implying that it will be removed if an identical normal defined (or weak) symbol, without errors (this makes it One-Definition-Rule so important, when the linker eliminates symbols it depends on the symbols being exactly the same).
Going back to compilation time, C++ standard explicitly states that only instantiated member functions are compiled, so it might be the case that the code that is compiled is smaller in the templated version (if some of the methods of the class are never called), which can reduce both compilation time and final binary size. If you only use std::vector::push_back, std::vector::begin and std::vector::end you will never compile std::vector::operator[], std::vector::insert...
Recent comments
12 hours 23 min ago
17 hours 27 min ago
17 hours 56 min ago
1 day 10 hours ago
1 day 17 hours ago
1 week 6 days ago
3 weeks 11 hours ago
3 weeks 1 day ago
3 weeks 3 days ago
3 weeks 4 days ago