回忆一下,传递数组或函数类型实参的时候,该实参自动转换为一个指针。
Recall that when we pass an argument of array or function type, that argument is automatically converted to an pointer.
第二个切点,employeeFinanceUpdates,描述了所有以update开头, 以Info, 结尾的,具有一个Employee类型实参的方法的调用点。
The second pointcut, employeeFinanceUpdates, describes all join points where there is a call to any method that begins with update, ends with Info, and has one argument of type Employee.
在编写扩展函数时,应谨慎处理根据实参类型进行的方法重载。
Be cautious about method overloading based on argument type when you write extension functions.
尽量尝试将您的扩展函数设计为仅使用双精度、字符串、布尔和节点集作为实参和返回值的类型。
Try to design your extension functions so that they use only doubles, strings, booleans, and node-sets as both arguments and return values.
但是对于MIME类型,您必须检查绑定来决定实参的类型。
But for MIME types you must inspect the binding to determine the real parameter types.
boolean形参只需标记字符本身就可以设置一个值,而其他类型的形参还需要某种附加的实参信息。
The Boolean parameters only need the flag character itself to set a value, but the other types of parameters require some sort of additional argument information.
函数原型定义了所有和函数相关的类型信息:函数返回类型是什么、函数的名字、应该给这个函数传递什么类型的实参。
The function prototype defines all the type information related to the function: what its return type is, the function name, and what types of arguments may be passed to it.
与任意函数调用一样,实参必须与它的形参匹配,它们的类型要么精确匹配,要么实参类型能够转换为形参类型。
As with any call, an argument might match its parameter either because the types match exactly or because there is a conversion from the argument type to the type of the parameter.
根据实参个数选出潜在的可行函数后,必须检查实参的类型是否与对应的形参类型匹配。
Having used the number of arguments to winnow the potentially viable functions, we must now look at whether the argument types match those of the parameters.
如果基类成员与派生类成员接受的实参不同,就没有办法通过基类类型的引用或指针调用派生类函数。
If the base member took different arguments than the derived-class member, there would be no way to call the derived function from a reference or pointer to the base type.
编译器将选出形参个数和类型都与实参匹配的函数。
The compiler selects those functions that have the required number of parameters and for which the argument types match the parameter types.
这里所谓“最佳”的细节将在下一节中解释,其原则是实参类型与形参类型越接近则匹配越佳。
The details of "best" here will be explained in the next section, but the idea is that the closer the types of the argument and parameter are to each other, the better the match.
为了确定最佳匹配,编译器将实参类型到相应形参类型转换划分等级。
In order to determine the best match, the compiler ranks the conversions that could be used to convert each argument to the type of its corresponding parameter.
在某些情况下,不可能推断模板实参的类型。
In some situations, it is not possible to deduce the types of the template arguments.
可以用单个实参来调用的构造函数定义了从形参类型到该类类型的一个隐式转换。
A constructor that can be called with a single argument defines an implicit conversion from the parameter type to the class type.
如果接口具有逆变类型形参,则允许其方法接受与接口类型形参指定的派生类型相比,派生程度更小的类型的实参。
An interface that has a contravariant type parameter allows its methods to accept arguments of less derived types than those specified by the interface type parameter.
在泛型接口或委托中,如果类型形参仅用作方法返回类型,而不用于方法实参,则可声明为协变的。
A type can be declared contravariant in a generic interface or delegate if it is used only as a type of method arguments and not used as a method return type.
相反的,一个非类型模板实参是模板里的常量,所以任何试图修改它的行为都是错误的。
Conversely, a non type template argument is a constant within the template so that an attempt to change the value of a parameter is an error.
在这种情况下,数组大小成为形参和实参类型的一部分。
In this case, the array size is part of the parameter and argument types.
如果接口具有协变类型形参,则允许其方法返回与接口类型形参指定的派生类型相比,派生程度更大的类型的实参。
An interface that has a covariant type parameter enables its methods to return more derived types than those specified by the type parameter.
从候选者列表中选择一个成员,并执行实参类型到形参类型的类型转换。
Selects a member from a list of candidates, and performs type conversion from actual argument type to formal argument type.
从候选者列表中选择一个成员,并执行实参类型到形参类型的类型转换。
Selects a member from a list of candidates, and performs type conversion from actual argument type to formal argument type.
应用推荐