Well, what was the point of adding std::any in C++17?
Generics aren't a cure-all, they merely duplicate code and change the type. Its not much better than copy-paste and replace the type names.
Generics aren't a cure-all, they merely duplicate code and change the type. Its not much better than copy-paste and replace the type names.
Nobody ever said that.
> . Its not much better than copy-paste and replace the type names.
Yes it is. You let the compiler do the job, instead of doing it manually.
There is no difference whatsoever between the same function duplicated with different types.
Don't be obtuse, nobody ever said "Generics are a cure-all".
> There is no difference whatsoever between the same function duplicated with different types.
Yes there is, it's called polymorphism.