摘要: 1. 什么是rValue?lValue呢?rValue主要是指没有名字的变量(即临时变量/对象);lValue主要是指有名字的变量。除了lValue都是rValue(废话)。下面的例子可以比较直观的帮助理解:int&& n = 42; // OK; 42 is an rvalue; n is rvalue reference.int k = n; // OK; n is rValue reference and is lValue.int&& j = k; // Error; k is an lvalueint&& m = k+1; // OK, 阅读全文
posted @ 2011-09-02 17:04 能巴 阅读(978) 评论(0) 推荐(0) 编辑