Boostライブラリのみを使用してテキストをファイルに出力できますか?
私が持っているコード(公式ドキュメント):
#include <ostream>
#include <boost/iostreams/device/file.hpp>
#include <boost/iostreams/stream.hpp>
namespace io = boost::iostreams;
int main()
{
io::stream_buffer<io::file_sink> buf("log.txt");
std::ostream out(&buf);
// out writes to log.txt
out << "abc";
}
別の方法はありますか?(私は標準ストリームを使いたくありません)。前もって感謝します。