Title
minor issue with char_traits, table 37
Status
cd1
Section
[char.traits.require]
Submitter
Andy Sawyer

Created on 2001-09-06.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Add the following to 21.1.1 para 1:

r denotes an lvalue of CharT

and change the description of assign in the table to:

  X::assign(r,d)   assigns r = d
Date: 2001-09-06.00:00:00

Table 37, in [char.traits.require], descibes char_traits::assign as:

  X::assign(c,d)   assigns c = d.

And para 1 says:

[...] c and d denote values of type CharT [...]

Naturally, if c and d are values, then the assignment is (effectively) meaningless. It's clearly intended that (in the case of assign, at least), 'c' is intended to be a reference type.

I did a quick survey of the four implementations I happened to have lying around, and sure enough they all have signatures:

    assign( charT&, const charT& );

(or the equivalent). It's also described this way in Nico's book. (Not to mention the synopses of char_traits<char> in 21.1.3.1 and char_traits<wchar_t> in 21.1.3.2...)

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2270
2001-09-06 00:00:00admincreate