yohhoyの日記

技術的メモをしていきたい日記

2012-07-10から1日間の記事一覧

tee ostream

C++

UNIX tee(2)コマンド っぽく動作するostream。ストリーム出力すると予めバインドした2個の出力ストリームに同データを転送する。 std::ofstream ofs("log.txt"); tee_ostream tee(std::cout, ofs); // teeストリーム作成 tee << "tee emulation" << std::end…