int *p;
decltype(*p); //解引用运算生成左值,所以结果是int&
decltype(&p); //取地址生成右值
pstr->size(); //返回一个左值
(*pstr).size(); //要看成员所属对象
cout<<( (it == vec.end())? "no" : "yes" )<< endl;
int fo(int a, int b)
{
return a + b;
}
int &t = fo(2, 3); //error:非常量引用初始值必须是左值
原文:http://www.cnblogs.com/Przz/p/92e582835e55fcb3ad7a5f1d101725a9.html