lvalue c++ question
Posted on 2012-12-25
If a1, a2, and a3 are of a user defined type, T, and you overload the * operator for T, then it may be possible to write:
(a1*a2) = a3;
This looks non-sensical. Yet, it compiles and runs, but I think the statement behaves like a noop.
Could you show me from the C++ standard how this can be? I thought the LHS of assignment operator is an lvalue. But a1*a2 does not look like an lvalue to me. I don't see what possible usefulness the above statement could have.