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?
i
2.1m questions
2.1m answers
60 comments
57.0k users