I.e. are these legal statements:
int x = 1, y = z = 2;
int& a = x, b = c = y;
with the intended result that a
is an alias for x
, whileb
and c
are aliases for y
?
I ask simply because I read here
Declaring a variable as a reference rather than a normal variable simply entails appending an ampersand to the type name
which lead me to hesitate whether it was legal to create multiple reference variables by placing &
before the variable name.