分享方式:


編譯器錯誤 C3638

'operator':無法重新定義標準 Boxing 和 Unboxing 轉換運算子

編譯器會為每個 Managed 類別定義轉換運算子,以支援隱含 Boxing。 無法重新定義這個運算子。

如需詳細資訊,請參閱 隱含 Boxing

下列範例會產生 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
}