Implicit buffers, overloading the assignment operator

Maybe there’s a way to do something inspired by

Then you can have A * x return some sort of multiplication proxy class that would itself be Into<Vector>, so the whole code would be something like y = (a*x + b).into();, with nothing actually evaluated until the .into(). Rust should make the much nicer, in fact, since the borrow checker can keep you from accidentally keeping things borrowed too long, which is a hazard for C++ expression templates when you try to do things like like x = a*x;.

2 Likes