总是按引用传递的坏习惯?
一个按引用传递的数值,标识该四元数的旋转角度(以弧度为单位)。
Angle a number, passed by reference, that identifies the Angle of rotation, in radians, of the quaternion.
因此,如果启用了按引用传递,则它将应用到应用程序中的所有远程接口,而不只是其中一个子集。
Therefore, if call by reference is enabled, it applies to all of the remote interfaces in the application, not only to a subset of them.
我们可以将按值和按引用传递的变量轻松地混合到 use子句中,并且可以顺利地处理这些变量。
We can mix variables passed by value and by reference easily within the use clause, and they will be handled without any problem.
参数按值传递的话,任何对该参数的修改都不会反射到调用这个方法的程序,使用按引用传递参数的人可能对这一点搞到困惑。
With pass by value, any change to the parameter is not reflected in the calling routine. Those who have used pass by reference will probably find this confusing.
enable-call-by-reference元素通常用于按引用传递参数,而不是按值传递,后者需要对参数做复制。
The enable-call-by-reference element is generally used to pass parameters by reference rather than by value, which requires making a copy of the parameters.
然而,您必须注意到这些可供选择的方案会将交互方法从按值传递(pass - by - value)改变为按引用传递(pass - by - reference)。
However, you must be aware that these alternatives change the semantics of the interaction from pass-by-value to pass-by-reference.
重要事项对于引用类型,按值传递参数会得到对所传递对象的引用的副本。
For reference types, if you pass a parameter by value, it results in a copy of the reference to an object being passed.
这允许被调用的方法修改该引用所引用的对象,因为引用本身是按引用来传递的。
This allows called methods to modify the object to which the reference refers because the reference itself is being passed by reference.
这允许被调用的方法修改该引用所引用的对象,因为引用本身是按引用来传递的。
This allows called methods to modify the object to which the reference refers because the reference itself is being passed by reference.
应用推荐