在任何时候只要见到常量引用(reference-to-const)参数,就存在建立临时对象而绑定在参数上的可能性。在任何时候只要见到函数返回对象,就会有一个临时对象被建立(以后被释放)。
基于10个网页-相关网页
You can declare tuples with the const qualifier, in which case the get call to access a particular element returns a reference to const.
可以使用const限定符来声明元组,在这种情况下,用于访问特定元素的get调用将返回对const的引用。
Your normal habit when passing an argument to a function should be to pass by const reference.
用常量引用给一个函数传递参数,是一种好的习惯。
Your normal habit when passing an argument to a function should be to pass by const reference.
当给函数传递参数时,你要养成的良好习惯是传递常量引用。
应用推荐