4

I was looking through the documentation on std::forward(), https://en.cppreference.com/w/cpp/utility/forward, while I came upon this snippet:

struct Arg
{
    int i = 1;
    int  get() && { return i; } // call to this overload is rvalue
    int& get() &  { return i; } // call to this overload is lvalue
};

What does the && after get() mean? Is it similar to int&& get() ?

John Tan
  • 1,331
  • 1
  • 19
  • 35

0 Answers0