使用者定義轉換不可以指定傳回類型
Example
下列範例會產生 C2549:
// C2549.cpp
// compile with: /c
class X {
public:
int operator int() { return value; } // C2549
// try the following line instead
// operator int() { return value; }
private:
int value;
};
使用者定義轉換不可以指定傳回類型
下列範例會產生 C2549:
// C2549.cpp
// compile with: /c
class X {
public:
int operator int() { return value; } // C2549
// try the following line instead
// operator int() { return value; }
private:
int value;
};