Actions
Bug #2723
closedIndentedStream duplicates output when stream is flushed multiple times
Start date:
04/02/2015
Due date:
% Done:
100%
Estimated time:
Description
The following snippet reproduces the problem:
std::ostringstream os;
os << "Hello" << std::endl;
{
IndentedStream os1(os, " [prefix] ");
os1 << "," << std::endl;
{
IndentedStream os2(os1, " [another prefix] ");
os2 << "World!" << std::endl;
}
}
std::cout << os.str() << std::endl;
Expected output:
Hello
[prefix] ,
[prefix] [another prefix] World!
Actual:
Hello
[prefix] ,
[prefix] ,
[prefix] [another prefix] World!
[prefix] [another prefix] World!
Actions