This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TC1 status.

115. Typo in strstream constructors

Section: D.13.5.2 [depr.strstream.cons] Status: TC1 Submitter: Steve Clamage Opened: 1998-11-02 Last modified: 2016-01-28

Priority: Not Prioritized

View all issues with TC1 status.

Discussion:

D.7.4.1 strstream constructors paragraph 2 says:

Effects: Constructs an object of class strstream, initializing the base class with iostream(& sb) and initializing sb with one of the two constructors:

- If mode&app==0, then s shall designate the first element of an array of n elements. The constructor is strstreambuf(s, n, s).

- If mode&app==0, then s shall designate the first element of an array of n elements that contains an NTBS whose first element is designated by s. The constructor is strstreambuf(s, n, s+std::strlen(s)).

Notice the second condition is the same as the first. I think the second condition should be "If mode&app==app", or "mode&app!=0", meaning that the append bit is set.

Proposed resolution:

In D.13.4.2 [depr.ostrstream.cons] paragraph 2 and D.13.5.2 [depr.strstream.cons] paragraph 2, change the first condition to (mode&app)==0 and the second condition to (mode&app)!=0.