Title
Bad use of casts in fstream
Status
cd1
Section
[file.streams]
Submitter
Vincent Leloup

Created on 2003-11-20.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

[ Sydney: Genuine defect. 27.8.1.13 needs a cast to cast away constness. The other two places are stylistic: we could change the C-style casts to const_cast. Post-Sydney: Howard provided wording. ]

Change 27.8.1.7/1 from:

Returns: (basic_filebuf<charT,traits>*)&sb.

to:

Returns: const_cast<basic_filebuf<charT,traits>*>(&sb).

Change 27.8.1.10/1 from:

Returns: (basic_filebuf<charT,traits>*)&sb.

to:

Returns: const_cast<basic_filebuf<charT,traits>*>(&sb).

Change 27.8.1.13/1 from:

Returns: &sb.

to:

Returns: const_cast<basic_filebuf<charT,traits>*>(&sb).

Date: 2003-11-20.00:00:00

[ifstream.members] p1, [ofstream.members] p1, [fstream.members] p1 seems have same problem as exposed in LWG issue 252.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2655
2003-11-20 00:00:00admincreate