The original case for not allowing references to temporaries was for function parameters. Suppose this was allowed:
void inc(double& x)
{ x += 0.1; }
int i = 0;
inc(i);
Why isn’t i
changed?
The original case for not allowing references to temporaries was for function parameters. Suppose this was allowed:
void inc(double& x)
{ x += 0.1; }
int i = 0;
inc(i);
Why isn’t i
changed?