Title
basic_ios default ctor
Status
c++11
Section
[basic.ios.cons]
Submitter
Martin Sebor

Created on 2009-10-25.00:00:00 last changed 161 months ago

Messages

Date: 2010-11-24.14:01:03

Proposed resolution:

Change [ios.base.cons] p1:

ios_base();

Effects: Each ios_base member has an indeterminate value after construction. These The object's members shall be initialized by calling basic_ios::init before the object's first use or before it is destroyed, whichever comes first; otherwise the behavior is undefined.. If an ios_base object is destroyed before these initializations have taken place, the behavior is undefined.

Change [basic.ios.cons] p2:

basic_ios();

Effects: Constructs an object of class basic_ios (27.5.2.7) leaving its member objects uninitialized. The object shall be initialized by calling its basic_ios::init before its first use or before it is destroyed, whichever comes first; otherwise the behavior is undefined. member function. If it is destroyed before it has been initialized the behavior is undefined.

Date: 2010-11-24.14:01:03

[ Adopted at 2010-11 Batavia ]

Date: 2010-10-21.19:06:53

[ Post-Rapperswil: ]

Moved to Tentatively Ready after 5 positive votes on c++std-lib.

Date: 2009-10-25.00:00:00

[ 2009-10-25 Daniel adds: ]

I agree, that your wording makes that clearer, but suggest to write

... calling basic_ios::init() before ...

Doing so, I recommend to adapt that of ios_base(); as well, where we have:

Effects: Each ios_base member has an indeterminate value after construction. These members shall be initialized by calling basic_ios::init. If an ios_base object is destroyed before these initializations have taken place, the behavior is undefined.

Date: 2011-05-03.22:13:16

The basic_ios default ctor is required to leave the objects members uninitialized (see below). The paragraph says the object must be initialized by calling basic_ios::init() before it's destroyed but I can't find a requirement that it be initialized before calling any of the class other member functions. Am I not looking in the right place or that an issue?

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-11-24 14:01:03adminsetmessages: + msg5421
2010-11-14 13:10:57adminsetstatus: voting -> wp
2010-11-08 14:14:39adminsetstatus: ready -> voting
2010-10-21 19:06:53adminsetmessages: + msg4765
2010-10-21 19:06:53adminsetstatus: new -> ready
2010-10-21 18:28:33adminsetmessages: + msg1314
2010-10-21 18:28:33adminsetmessages: + msg1313
2009-10-25 00:00:00admincreate