158. Underspecified semantics for setbuf()

Section: 30.6.3.4.2 [streambuf.virt.buffer] Status: TC1 Submitter: Dietmar Kühl Opened: 1999-07-20 Last modified: 2016-02-10

Priority: Not Prioritized

View all other issues in [streambuf.virt.buffer].

View all issues with TC1 status.

Discussion:

The default behavior of setbuf() is described only for the situation that gptr() != 0 && gptr() != egptr(): namely to do nothing. What has to be done in other situations  is not described although there is actually only one reasonable approach, namely to do nothing, too.

Since changing the buffer would almost certainly mess up most buffer management of derived classes unless these classes do it themselves, the default behavior of setbuf() should always be to do nothing.

Proposed resolution:

Change 30.6.3.4.2 [streambuf.virt.buffer], paragraph 3, Default behavior, to: "Default behavior: Does nothing. Returns this."