illegal use of this type as an expression请问这个问题该怎么解决?
class X
{
class Trouble{};
class Small:public Trouble {};
class Big:public Trouble {};
void f()
{
throw Big(); //这里如果把Big后面的括号去掉,就会产生c2275错误
}
};
//c2275错误的描述就是标题那里的
//illega use of this type as an expression
//这个错误在msdn里面也有个例子
typedef struct S
{
int mem;
}*S_t;
void func1(int *parm);
void func2()
{
func1(&S_t->mem); //c2275, S_t is a typedef
}