【发布时间】:2014-03-01 19:24:07
【问题描述】:
从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;
}
}
【问题讨论】:
标签: c++ iostream icc streambuf