3 ms·
Templates expand, and can generate arbitrary amounts of code. If you, as a developer, don't see what happens, then you might miss it. Templates can also expand
by ChrisLomont 5y ago
Templates expand, and can generate arbitrary amounts of code. If you, as a developer, don't see what happens, then you might miss it.
Templates can also expand on each type they use, or combination of types, generating much more code, when non-template solutions could have avoided it. Of course, templates could avoid it too, but they're much harder to write and see how they expand.
That said, templates also allow making code shorter and cleaner.
So some people, once bitten by bad templates or bad usage, complain without learning how to use them. Yet another C++ ocean of complexity :)