我在 Eclipse CDT (Juno SR1) 中有以下代码:
#include <fstream>
#include <iostream>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/filtering_streambuf.hpp>
#include <boost/iostreams/copy.hpp>
int main()
{
using namespace std;
namespace io = boost::iostreams;
ifstream file("data.gz", ios_base::in | ios_base::binary);
io::filtering_streambuf<io::input> in;
in.push(io::gzip_decompressor()); // error here
in.push(file); // and here
}
g++ 4.7.2
代码没有问题。然而,Eclipse 抱怨这两in.push()
行。两种情况下的错误消息是相同的:
Invalid arguments '
Candidates are:
void push(std::basic_streambuf<#10000,#10001> &, ?, ?)
void push(std::basic_istream<#10000,#10001> &, ?, ?)
void push(std::basic_ostream<#10000,#10001> &, ?, ?)
void push(std::basic_iostream<#10000,#10001> &, ?, ?)
void push(const boost::iterator_range<#10000> &, ?, ?)
void push(const boost::iostreams::pipeline<#10000,#10001> &)
void push(const #10000 &, ?, ?, boost::disable_if<boost::iostreams::is_std_io<#10000>,void>::type *)
'
如何解决或解决此问题以停止 CDT 抱怨?