Title
missing casts/C-style casts used in iostreams
Status
cd1
Section
[string.streams]
Submitter
Martin Sebor

Created on 2000-07-28.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In 27.7.2.2, p1 replace

  -1- Returns: (basic_stringbuf<charT,traits,Allocator>*)&sb.

with

  -1- Returns: const_cast<basic_stringbuf<charT,traits,Allocator>*>(&sb).

In 27.7.3.2, p1 replace

  -1- Returns: (basic_stringbuf<charT,traits,Allocator>*)&sb.

with

  -1- Returns: const_cast<basic_stringbuf<charT,traits,Allocator>*>(&sb).

In 27.7.6, p1, replace

  -1- Returns: &sb

with

  -1- Returns: const_cast<basic_stringbuf<charT,traits,Allocator>*>(&sb).

In D.7.2.2, p1 replace

  -2- Returns: &sb. 

with

  -2- Returns: const_cast<strstreambuf*>(&sb).
Date: 2000-07-28.00:00:00

27.7.2.2, p1 uses a C-style cast rather than the more appropriate const_cast<> in the Returns clause for basic_istringstream<>::rdbuf(). The same C-style cast is being used in 27.7.3.2, p1, D.7.2.2, p1, and D.7.3.2, p1, and perhaps elsewhere. 27.7.6, p1 and D.7.2.2, p1 are missing the cast altogether.

C-style casts have not been deprecated, so the first part of this issue is stylistic rather than a matter of correctness.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2010
2000-07-28 00:00:00admincreate