3 ms·
> Early C++ was famous for code bloat and (apparently) hasn't shaken that outdated impression. It's not an outdated impression. C++ generics can and do interac
by asdfasgasdgasdg 5y ago
> Early C++ was famous for code bloat and (apparently) hasn't shaken that outdated impression.
It's not an outdated impression. C++ generics can and do interact very poorly with inlining and other language features to cause extremely large binary sizes, especially if you do anything complex inside them. They also harm compilation performance since each copy of the generic code needs to be optimized.
Generics in C++ are reasonably efficient when there is relatively little code generated per generic, but when this is not true, they can be a problem.