4 ms·
It's because defining "customization points" as operators make it easier to write templates, essentially. See "C++ doesn’t know how to do customization points t
by pcwalton 8y ago
It's because defining "customization points" as operators make it easier to write templates, essentially. See "C++ doesn’t know how to do customization points that aren’t operators": https://quuxplusone.github.io/blog/2018/08/23/customization-point-or-named-function-pick-one/ https://quuxplusone.github.io/blog/2018/08/23/customization-...
This is one of the downsides of not having typeclasses that is often forgotten about.
- cheez 8y agoThat's why I cannot wait for concepts
- aaaaaaaaaab 8y agoWouldn’t uniform call syntax (like in D) solve most of the issues outlined above? I.e. it always boils down to “primitive types can’t have methods”; but uniform call syntax would let us call any function like a method on its first argument...
- pcwalton 8y agoOr just allow methods to be defined on primitive types, like Rust.
- aaaaaaaaaab 8y agoUniform call syntax is a superset of that, since you can’t have virtual methods on primitive types.