3 ms·
"First of all, generics without duck typing are greatly appreciated." Err..C++ has concepts. No duck typing required.
by lenkite 4y ago
"First of all, generics without duck typing are greatly appreciated."
Err..C++ has concepts. No duck typing required.
- mlindner 4y agoOnly C++20 has concepts, which is a lot newer than Rust is. I've yet to ever see a C++20 concept in the wild or anyone using one outside of an example. Heck, if you ask the average C++ programmer about concepts they'll likely have not even heard of them.
- Kranar 4y agoErr... C++20 added concepts but not definition checking, so templates are still duck typed. That is, it is still possible for a substitution failure to occur after performing a concept check. Definition checking would eliminate such failures. In every language that I can think of that supports generic programming (including Go), there's support for definition checking.