How to pipe into std::cout with boost::iostreams

前端 未结 3 1754
小蘑菇
小蘑菇 2021-01-14 05:16

I am new to boost::iostreams so this might be trivial:

Assuming namespace io = boost::iostreams;

this works

io::fil         


        
3条回答
  •  再見小時候
    2021-01-14 05:48

    Wrapping std::cout with boost::ref worked for me:

    io::filtering_ostream out(DummyOutputFilter() | boost::ref(std::cout));
    

    See note_1 in pipable docs for details.

提交回复
热议问题