編譯器錯誤 C3195
'operator': 已被保留,不能做為 ref 類別或實值型別的成員。 必須使用 'operator' 關鍵字定義 CLR 或 WinRT 運算子
編譯器偵測到使用 Managed Extensions for C++ 語法的運算子定義。 您必須針對運算子使用C++語法。
下列範例會產生 C3195,並示範如何修正此問題:
// C3195.cpp
// compile with: /clr /LD
#using <mscorlib.dll>
value struct V {
static V op_Addition(V v, int i); // C3195
static V operator +(V v, char c); // OK for new C++ syntax
};