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

837. basic_ios::copyfmt() overly loosely specified

Section: [basic.ios.members] Status: NAD Editorial Submitter: Martin Sebor Opened: 2008-05-17 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [basic.ios.members].

View all issues with NAD Editorial status.


The basic_ios::copyfmt() member function is specified in [basic.ios.members] to have the following effects:

Effects: If (this == &rhs) does nothing. Otherwise assigns to the member objects of *this the corresponding member objects of rhs, except that

Since the rest of the text doesn't specify what the member objects of basic_ios are this seems a little too loose.

[ Batavia (2009-05): ]

We agree with the proposed resolution. Move to NAD Editorial.

Proposed resolution:

I propose to tighten things up by adding a Postcondition clause to the function like so:


copyfmt() postconditions
Element Value
rdbuf() unchanged
tie() rhs.tie()
rdstate() unchanged
exceptions() rhs.exceptions()
flags() rhs.flags()
width() rhs.width()
precision() rhs.precision()
fill() rhs.fill()
getloc() rhs.getloc()

The format of the table follows Table 117 (as of N2588): basic_ios::init() effects.

The intent of the new table is not to impose any new requirements or change existing ones, just to be more explicit about what I believe is already there.