Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

Compiler Warning (level 1) C4674

Error Message

'method' should be declared 'static' and have exactly one parameter

The signature of a conversion operator was not correct. The method is not considered a user-defined conversion.

When using the new syntax (/clr), see User-Defined Operators and User-Defined Conversions for information on defining operators.

Example

The following sample generates C4674.

// C4674.cpp
// compile with: /clr /WX /W1 /LD
ref class G {
   int op_Implicit(int i) {   // C4674
      return 0;
   }
};

The following sample generates C4674.

// C4674_b.cpp
// compile with: /clr:oldSyntax /W1 /LD
__gc class G {
   int op_Implicit(int i) {   // C4674
   // try the following line instead
   // static int op_Implicit(int i) {
      return 0;
   }
};
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.