Would Generics break code?
I'm not sure if this question is better suited for r/cpp_questions or not but here is it. If the type checking for generic functions was to be done before instantiations like many other languages do, how much code would break. One obvious answer is all of it because we didn't have concepts till c++20 but just assume that it is somehow taken care of. I'm more interesting in knowing about what kind of code would we not be able to write anymore.
4 comments · 44% upvoted · other discussions
C++ templates are not like generics in other languages. Trying to change templates to generics would completely break the language.