编译器错误 C3638

“operator”:标准装箱和取消装箱转换运算符不能重新定义

编译器为每个托管类定义一个转换运算符,以支持隐式装箱。 无法重新定义此运算符。

有关详细信息,请参阅隐式装箱

以下示例生成 C3638:

// C3638.cpp
// compile with: /clr
value struct V {
   V(){}
   static operator V^(V);   // C3638
};

int main() {
   V myV;
   V ^ pmyV = myV;   // operator supports implicit boxing
}