什么错误?报std::bad_alloc不是std的成员,未知重写说明符
VC2008,代码:
inline void* operator new(size_t size)
#ifndef _STLPORT_VERSION
throw (std::bad_alloc)
//上面这行报错。如果改成throw (bad_alloc),vc代码提示能识别是std::bad_alloc
#endif
{
return malloc(size);
}
编译时报错:
error C2039: “bad_alloc”: 不是“std”的成员
error C2146: 语法错误: 缺少“)”(在标识符“bad_alloc”的前面)
error C3646: “bad_alloc”: 未知重写说明符
error C2059: 语法错误:“)”
[解决办法]
包含了bad_alloc需要的头文件没有?