NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Error C2813

'operator name' : invalid number of arguments for the managed operator 'operator symbol'

The declaration of an operator specified too many parameters.

The following sample generates C2813:

#using<mscorlib.dll>
using namespace System;

__gc class G {
   Int32 j;
public:
   G(Int32 n) : j(n) {
   };

   static bool op_Equality(G* g1, G* g2, G* g3) {   // C2813, equality operator takes two arguments
   // the following line declares the correct number of arguments
   // static bool op_Equality(G* g1, G* g2) {
      return g1->j == g2->j;
   };
};

void main() {
}