Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Error C3920

Error Message

'operator'' : cannot define a postfix increment/decrement CLR operator

The common language runtime does not support the postfix operator and user-defined postfix operators are not allowed. You can define a prefix operator and the prefix operator will be used for both pre- and post-increment operations.

The following sample generates C3920:

// C3920.cpp
// compile with: /clr /LD
public value struct V {
   static V operator ++(V me, int)
   // try the following line instead
   // static V operator ++(V me)
   {   // C3920
      me.m_i++;
      return me;
   }

   int m_i;
};

Community Additions

ADD
Show:
© 2015 Microsoft