&&เป็นโอเปอเรเตอร์อ้างอิงใหม่ที่กำหนดไว้ในมาตรฐาน C++11 int&&a หมายถึง "a" เป็นการอ้างอิงค่า r &&มักใช้เพื่อประกาศพารามิเตอร์ของฟังก์ชันเท่านั้น และใช้นิพจน์ค่า r เท่านั้น
พูดง่ายๆ ค่า r คือค่าที่ไม่มีที่อยู่หน่วยความจำ เช่น. ตัวเลข 6 และอักขระ 'v' เป็นทั้งค่า r int a เป็นค่า l อย่างไรก็ตาม (a+2) เป็นค่า r
ตัวอย่าง
void foo(int&& a)
{
//Some magical code...
}
int main()
{
int b;
foo(b); //Error. An rValue reference cannot be pointed to a lValue.
foo(5); //Compiles with no error.
foo(b+3); //Compiles with no error.
int&& c = b; //Error. An rValue reference cannot be pointed to a lValue.
int&& d = 5; //Compiles with no error.
} คุณสามารถอ่านเพิ่มเติมเกี่ยวกับค่า R และตัวดำเนินการนี้ได้ที่ http://blogs.msdn.com/b/vcblog/archive/2009/02/03/rvalue-references-c-0x-features-in-vc10-part- 2.aspx