Is always passing by reference a bad practice?
总是按引用传递的坏习惯?
Do not confuse the concept of passing by reference with the concept of reference types.
不要将“通过引用传递”概念与“引用类型”概念相混淆。
A passing reference in a recent profile by Glamour magazine to her 20-hour workdays prompted an outpouring of admiration.
《魅力》杂志最近在一篇简介中简短提到,她一天工作20个小时,博得一片赞叹之声。
The previous section showed how to reference another sequence diagram by passing information through parameters and return values.
前面的段落展示如何通过参数和返回值传递信息,引用另一个序列图。
Two transfer mechanisms are available: passing by value (inline) and by reference.
有两个可用转换机制:通过值传递(内联)和通过引用传递。
We've mitigated that to some extent by factoring out the lookupService() method and passing just the reference name.
可以通过分解lookupService()方法和仅传递引用名称这样的措施在一定程度上缓解这个问题。
As the above example also shows, passing use variables by reference is one way you can allow the closure to modify values.
上面的例子还显示出,通过引用传递使用变量是允许closure修改变量的方法之一。
You first get a reference to the unordered list from Listing 3 by passing a CSS selector to jQuery.
您首先可以通过向jQuery传递一个CSS选择器从清单3中获取这个无序列表的一个引用。
Access to the WSDL of the notification listener service can be provided when the provider's web service is deployed or at runtime by passing a reference to the WSDL on the initial request.
通过在初始请求上传递WSDL的引用可以在提供者的Web服务被部署时或运行时提供对通知侦听器服务的WSDL的访问权。
When an XQuery is used, the connector does not support passing the XML result by reference due to difficulties in constructing a LOB locater.
当使用了XQuery时,连接器将不支持通过引用传递XML结果,因为构造LO b定位器比较困难。
There's an SCA component passing some double values by reference to another SCA component, so no data transformations or protocol translations have to take place.
一个SCA组件通过参照另一个SCA组件传递一些double值。因此没有出现数据转换或协议转换。
Your normal habit when passing an argument to a function should be to pass by const reference.
用常量引用给一个函数传递参数,是一种好的习惯。
Passing types by reference (using out or ref) requires experience with Pointers, understanding how value types and reference types differ, and handling methods with multiple return values.
使用引用类型参数,需要了解值类型和引用类型的差别,同时,使用这个方法将会有多个返回值。
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.
当给函数传递参数时,你要养成的良好习惯是传递常量引用。
应用推荐