Export (0) Print
Expand All
Expand Minimize

Compiler Error C3195

Error Message

'operator' : is reserved and cannot be used as a member of a ref class or value type. CLR operators must be defined using the 'operator' keyword

The compiler detected an operator definition using the Managed Extensions for C++ syntax.

Either use the new C++ syntax or use the /clr:oldSyntax compiler option to enable the Managed Extensions for C++ syntax.

The following sample generates 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 
};

Community Additions

ADD
Show:
© 2014 Microsoft