我从std::streambuf
说析构函数不兼容继承时收到 ICL 编译器警告,有什么想法我在这里做错了吗?使其成为虚拟析构函数也不起作用。
警告 #809:虚函数“CAbcBuffer::~CAbcBuffer”的异常规范与覆盖函数“std::basic_streambuf<_Elem, _Traits>::~basic_streambuf [with _Elem=char, _Traits=std::char_traits] 的异常规范不兼容"
class CAbcBuffer : public std::streambuf
{
protected:
/** Work buffer */
char *buffer;
public:
explicit CAbcBuffer()
{
/*
Stores the beginning pointer, the next pointer, and the end pointer for the
input buffer
*/
buffer = new char[100];
std::streambuf::setg(buffer, buffer, buffer);
}
~CAbcBuffer() {
delete [] buffer;
}
}