Constant as rvalue in C++(11)

前端 未结 4 1375
孤城傲影
孤城傲影 2021-02-20 13:33

Why const int is not an R-value in C++(11)? I thought that R-value was \'anything\' which cannot be on the left hand side and constants fulfil that

4条回答
  •  甜味超标
    2021-02-20 14:00

    In the simple words, you should be able to 'steal' the value of rvalue. This is the whole point of different treatment of rvalues. So rvalue should be unnamed-going-to-die-in-near-future-something.

提交回复
热议问题