非类类型的纯右值不能进行cv限定。(反过来,类类型的纯右值可以进行cv限定这件事情其实挺坑的,比如要考虑const std::string和std::string的不同) int fun() const int fun() // the same std::string foo() /*(1.)*/ const std::string foo() // not the same /*(2.)*/
非类类型的纯右值不能进行cv限定。(反过来,类类型的纯右值可以进行cv限定这件事情其实挺坑的,比如要考虑const std::string和std::string的不同)
int fun() const int fun() // the same std::string foo() /*(1.)*/ const std::string foo() // not the same /*(2.)*/
那么一和二有什么区别呢?