Project

General

Profile

Bug #2723

IndentedStream duplicates output when stream is flushed multiple times

Added by Alex Afanasyev almost 6 years ago. Updated almost 6 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

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

Actions
#1

Updated by Alex Afanasyev almost 6 years ago

  • Blocks Task #2250: ndns-list-zone: Change output format for ID-CERTs added
#2

Updated by Alex Afanasyev almost 6 years ago

  • Status changed from In Progress to Code review
#3

Updated by Alex Afanasyev almost 6 years ago

  • Status changed from Code review to Closed

Applied in changeset commit:ndn-cpp-dev|17ef37d0e67fa40b169390176100b7139da70309.

Also available in: Atom PDF