我是新手,boost::iostreams
所以这可能是微不足道的:
假设namespace io = boost::iostreams;
这行得通
io::filtering_ostream out(std::cout);
out << "some\nstring\n";
这有效
std::string result;
io::filtering_ostream out(io::counter() | io::back_inserter(result));
out << "some\nstring\n";
但这不能编译
io::filtering_ostream out(io::counter() | std::cout);
out << "some\nstring\n";
你怎么插管std::cout
?