4 ms·
Type safety, overloading, doesn’t play well with arrays (T[]), and other baggage related to the lack of value types, (e.g. <Integer> is ok but not <int>). C++
by geophile 6y ago
Type safety, overloading, doesn’t play well with arrays (T[]), and other baggage related to the lack of value types, (e.g. <Integer> is ok but not <int>).
C++ also does not rely on type erasure.
- kaba0 6y agoWhat’s up with type safety? The only escape hatch is casting (and of course co/contra/invariance, but it is a semantic issue). Overloading may be a legit issue, but I am yet to run into it, you are right about arrays and value types, but they are being worked on and hopefully project valhalla can solve these issues. C++’s templates have different trade-offs (lack of semantic validation, though perhaps it is solved by concepts and constraints? I haven’t looked into them yet)