>>107790278
>c++ templates are zero overhead and generated at compile time
I can only think of Java and Go as examples of AOT compiled languages where generics impose a runtime cost. C++ isn't unique in the slightest.
>there is nothing you could do to improve them while keeping their advantages
There are lots of things you can do to improve them like fixing inference, doing away with the shitty qualifier mechanics, having deeper integration with the language, a better compilation procedure, etc.
Anon, every time you post you make it clear to me that you really don't understand this level of language design. The focus on syntax and surface level details, they have nothing to do with what I'm talking about.
template<class T>
T add(T a, T b);
auto x = add(1, 1);
auto y = add(1.0f, 1.0f);
How does the compiler deduce the types of a and b for x and y? How does it deduce the types for x and y?
>It looks at what's being passed in....
Comment too long. Click here to view the full text.