3 ms·
This is a common sentiment I think, but operator overloading, at least in the context of numerical analysis, has perfectly sensible standards already, as in Mat
by conistonwater 11y ago
This is a common sentiment I think, but operator overloading, at least in the context of numerical analysis, has perfectly sensible standards already, as in Matlab, R, python, julia, and the like, yet C++ under-uses it and doesn't even provide anything overloadable for matrix-multiplication (like `.* ` vs `* `) or a linear solve `\` operator. C is even worse, since you can't even define arithmetic operators for a custom numerical type.
- Retra 11y agoThat's true if you're only looking at arithmetical operators. C++ most often overloads assignment and indexing operators. You can even overload the cast operator, and if that isn't confusing and unnecessary... just don't ever use std::vector<bool>.