'function' :數位多載沒有 'this' 指標的法律轉換
備註
編譯程式無法轉換成 this 成員函式的任何多載版本。
此錯誤可能是在物件上const叫用非const成員函式所造成。 可能的解決方案:
const從物件宣告中移除 。將 新增
const至其中一個成員函式多載。
Example
下列範例會產生 C2663:
// C2663.cpp
struct C {
void f() volatile {}
void f() {}
};
struct D {
void f() volatile;
void f() const {}
};
const C *pcc;
const D *pcd;
int main() {
pcc->f(); // C2663
pcd->f(); // OK
}