“identifier”:将成员用作默认参数需要静态成员
将非静态成员用作默认参数。
下面的示例生成 C2648:
// C2648.cpp
// compile with: /c
class C {
public:
int i;
static int j;
void func1( int i = i ); // C2648 i is not static
void func2( int i = j ); // OK
};
“identifier”:将成员用作默认参数需要静态成员
将非静态成员用作默认参数。
下面的示例生成 C2648:
// C2648.cpp
// compile with: /c
class C {
public:
int i;
static int j;
void func1( int i = i ); // C2648 i is not static
void func2( int i = j ); // OK
};