'operator operator' 必須是非靜態成員
備註
下列運算子只能多載為非靜態成員:
分配
=類別成員存取
->註標
[]函數調用
()
可能的 C2801 原因:
多載運算子不是類別、結構或等位成員。
多載運算子宣告為
static。
Example
- 下列範例會產生 C2801:
// C2801.cpp
// compile with: /c
operator[](); // C2801 not a member
class A {
static operator->(); // C2801 static
operator()(); // OK
};