This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
Compiler Error C2801
'operator operator' must be a nonstatic member
The following operators can be overloaded only as nonstatic members:
- Assignment =
- Class member access ->
- Subscripting []
- Function call ( )
Possible causes
- Overloaded operator is not a class, structure, or union member.
- Overloaded operator is declared static.
Example
operator[](); // error, not a member
class A
{
static operator->(); // error, static
operator()(); // OK
};