Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
'operator operator' must be a non-static member
Remarks
The following operators can be overloaded only as nonstatic members:
Assignment
=Class member access
->Subscripting
[]Function call
()
Possible C2801 causes:
Overloaded operator is not a class, structure, or union member.
Overloaded operator is declared
static.
Example
- The following example generates C2801:
// C2801.cpp
// compile with: /c
operator[](); // C2801 not a member
class A {
static operator->(); // C2801 static
operator()(); // OK
};