我会简短:我有这段代码:
QByteArray MyNBT::decompressData(QByteArray data)
{
filtering_streambuf<input> in;
std::string _data = data.data();
in.push( gzip_decompressor() );
in.push( boost::iostreams::back_inserter(_data) );
//in.push( std::back_inserter(_data) );
std::stringstream _sstream;
boost::iostreams::copy(in, _sstream);
QByteArray out = _sstream.rdbuf()->str().c_str();
return out;
}
它在这一行给出了一个错误:
in.push( boost::iostreams::back_inserter(_data) );
//in.push( std::back_inserter(_data) );
错误是:
/usr/include/boost/iostreams/chain.hpp:244: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>'
BOOST_STATIC_ASSERT((is_convertible<category, Mode>::value));
^
编译器会在std::back_inserter(_data)
boost 的错误中一次两次地抛出这个错误。
提前致谢。