Created on 1998-06-21.00:00:00 last changed 172 months ago
Rationale:
The LWG believes the difficulty of specifying correct semantics outweighs any benefit of allowing ios_base objects to be copyable.
Proposed resolution:
In [ios.base], class ios_base, specify the copy constructor and operator= members as being private.
As written, ios_base has a copy constructor and an assignment operator. (Nothing in the standard says it doesn't have one, and all classes have copy constructors and assignment operators unless you take specific steps to avoid them.) However, nothing in 27.4.2 says what the copy constructor and assignment operator do.
My guess is that this was an oversight, that ios_base is, like basic_ios, not supposed to have a copy constructor or an assignment operator.
Jerry Schwarz comments: Yes, its an oversight, but in the opposite sense to what you're suggesting. At one point there was a definite intention that you could copy ios_base. It's an easy way to save the entire state of a stream for future use. As you note, to carry out that intention would have required a explicit description of the semantics (e.g. what happens to the iarray and parray stuff).
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg116 |
2010-10-21 18:28:33 | admin | set | messages: + msg115 |
1998-06-21 00:00:00 | admin | create |