Users of your type might need to perform multiple casts to invoke the conversion operators, a practice that leads to unmaintainable code.
用户可能须要对类型进行多样化的强制转换操作,这样的实际操作可能产生不维护的代码。
However, you can define implicit conversion operators for a type, which enable you to use the assignment operator with those types.
不过,可为类型定义隐式转换运算符,这样就可以对这些类型使用赋值运算符。
When you define a class or structure, you can define one or more conversion operators to convert that class or structure type to other types.
当您定义类别或结构时,可以定义一或多个将该类别或结构型别转换为其他型别的转换运算子。
When you define a class or structure, you can define one or more conversion operators to convert that class or structure type to other types.
当您定义类别或结构时,可以定义一或多个将该类别或结构型别转换为其他型别的转换运算子。
应用推荐