According to C++03 3.10/1 every expression is either an lvalue or an rvalue. When I use =
to assign a new value to a variable the variable name on the left of the assignment is an lvalue expression. And it looks like whatever I try to do with a variable it'll still use some expression.
Is there any way to manipulate a variable in C++ other than by using an expression?
=
. Thats why I considered prefix++
to be an exception, because the variable is logically only incremented, but not really read (at least not on the "C++-level") – Detraction=
inside. In fact1 + 2
is an arithmetic expression, too, since it can be evaluated (to3
of typeint
), and so can++a
, having the type and value ofa
after the increment. In fact just writinga
is an expression with the value and type ofa
(or an lvalue reference toa
?). – Especial1
is an expression, you don't need1+2
. – Whitesmithasm
block is a declaration, but you put string literal(s) inside it, and a literal is an expression. – Contraption