For a type conversion operator, either the operand or the return type must be of the data type of the class or structure.
对于类型转换运算符,操作数或返回类型必须是类或结构的数据类型。
The implicit conversion operator is defined, which converts a Point type to int.
隐式转换操作符将Point类型转换为int。
A definition of a conversion operator that returns the type of your class or structure.
一个转换运算符的定义,返回您的类或结构的类型。
The source type provides the conversion operator.
源类型提供转换运算符。
A definition of a conversion operator where the argument is of the type of your class or structure.
转换运算子的定义,其中引数的型别就是类别或结构的型别。
To use the operator, you must overload it for the specified type or define a conversion to a type for which the operator is defined.
若要使用此运算子,您必须将此运算子对指定的型别加以多载,或定义一个此运算子已定义型别的转换。
The conversion operator converts from a source type to a target type.
转换运算符将源类型转换为目标类型。
A conversion operator provides a way for you to define how an object can be converted automatically to a different type.
当类较多且经常需要进行类型之间的转换时,定义类型转换操作符还是很方便的。
DateTime type should not be implemented as a conversion operator. Use a constructor to convert a type to another type that is not in the same domain.
另外,定义此运算子的支援可以是范例的形式,其中有一个或多个类似的型别需要这类转换。
However, you can define implicit conversion operators for a type, which enable you to use the assignment operator with those types.
不过,可为类型定义隐式转换运算符,这样就可以对这些类型使用赋值运算符。
However, you can define implicit conversion operators for a type, which enable you to use the assignment operator with those types.
不过,可为类型定义隐式转换运算符,这样就可以对这些类型使用赋值运算符。
应用推荐