Project

General

Profile

Actions

Bug #2723

closed

IndentedStream duplicates output when stream is flushed multiple times

Added by Alex Afanasyev about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Utils
Target version:
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!

Related issues 1 (0 open1 closed)

Blocks ndns - Task #2250: ndns-list-zone: Change output format for ID-CERTsClosedJiewen Tan11/30/2014

Actions
Actions

Also available in: Atom PDF