引用(reference)是某个对象的别名。 对常量的引用(reference to const)是一个引用,不能用来改变它所绑定对象的值。对常量的引用可以绑定常量对象,或者非常量对象,或者表达式的结果。
基于12个网页-相关网页
reference-to-const 常量引用 ; 对象的引用
pass by reference-to-const 引用进行传递
reference-to-non-const 量引用 ; 非常量引用
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.
当给函数传递参数时,你要养成的良好习惯是传递常量引用。
应用推荐