C++ “hello world” Boost tee example program
问题 The Boost C++ library has Function Template tee The class templates tee_filter and tee_device provide two ways to split an output sequence so that all data is directed simultaneously to two different locations. I am looking for a complete C++ example using Boost tee to output to standard out and to a file like "sample.txt". 回答1: Based on help from the question John linked: #include <boost/iostreams/tee.hpp> #include <boost/iostreams/stream.hpp> #include <fstream> #include <iostream> using std