C/C++ Compiler (cl.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
C2801
                                             Up Contents Index Back
────────────────────────────────────────────────────────────────────────────
 
     Compiler error C2801
 
     operator 'symbol' must be a nonstatic member
 
     The specified overloaded operator was not a member of a class,
     structure, or union, and/or was declared as static.
 
     The following operators can only be overloaded in class scope
     as nonstatic members: assignment operator '=', class member
     access operator '->', subscripting operator '[]', and function
     call operator '()'.
 
     The following are examples of this error:
 
          operator[]();            // error, not a member
 
          class A
          {
             static operator->();  // error, static
             operator()();         // OK
          };
                                    -♦-