3 ms·
Duck typing can still be a compile-time thing… C++ templates are “duck typed” in that the template can’t specify the bounds for the passed-in type, but if you p
by ninkendo 5y ago
Duck typing can still be a compile-time thing… C++ templates are “duck typed” in that the template can’t specify the bounds for the passed-in type, but if you pass the wrong type, it still breaks at compile time instead of runtime. (It’s just that the error messages are way more impenetrable than they otherwise could be.)
- wk_end 5y agoI’d argue that either “runtime is compile time in the case of C++ templates” and/or “C++ templates are structurally typed”, especially now that concepts are a thing. ETA: and/or that talking about C++ templates as "typed" one way or another is problematic, given that they're a part of the type system.