将输出语句添加到构造函数、析构函数和复制构造函数,以查看在运行程序时命名返回值优化的效果。
Add output statements to the constructor, destructor and copy constructor to see the effect of the Named Return Value optimization when you run the program.
要调用函数并使用它的返回值作为语言表达式的一部分,只需要命名它并附加一个使用圆括号括起的参数列表。
To call a function and use its return value as part of a larger expression, simply name it and append a parenthesized argument list.
有了多个返回值,有良好的代码文档会更好——而Go允许你给返回值命名,就像参数一样。
With multiple return values, it is good to have the code document which is which - go allows you to give the return values names, just like parameters.
有了多个返回值,有良好的代码文档会更好——而Go允许你给返回值命名,就像参数一样。
With multiple return values, it is good to have the code document which is which - go allows you to give the return values names, just like parameters.
应用推荐