3 ms·
> For example, if your code involves a lot of linear algebra, then operator overloading the sensible operators is probably a good thing. Operator overloading c
by arinlen 4y ago
> For example, if your code involves a lot of linear algebra, then operator overloading the sensible operators is probably a good thing.
Operator overloading can be totally useless in linear algebra applications as the algorithms for basic linear algebra operations (read BLAS) aggregate multiple algebraic operations (axpy, gemv,gemm).
- magicalhippo 4y agoTrue. I was thinking mostly about things like 3d renderers and such, where you do a lot of simple operations on vectors and matrices. I've written renderers with both operator overloading and without, and the readability of the former is, to me, vastly better.