search

Home  >  Q&A  >  body text

c++ - 有没有const右值引用?

我只见过这种形式:

int&&a=3;

那么有没有const int&&a=3这种形式呢?为什么

PHP中文网PHP中文网2786 days ago977

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 13:15:24

    There is this type of left and right value references for the completeness of semantics, but rvalues ​​are used to match the movement semantics. Think about the literal values ​​or checkpoint values ​​included in rvalues, constant rvalue references are of no use. Refer to the in-depth understanding of C++11 3.3.3

    reply
    0
  • PHPz

    PHPz2017-04-17 13:15:24

    Where does the move semantics of constant rvalue appear? Find out this usage scenario

    reply
    0
  • Cancelreply