Topic: N2369 Defect: char_traits::not_eof has wrong signature
Author: bop@gmb.dk ("Bo Persson")
Date: Mon, 13 Aug 2007 06:16:17 GMT Raw View
The changes made for constexpr in [char.traits.specializations.*] have
not only changed the not_eof function from pass by const reference to
pass by value, it has also changed the parameter type from int_type to
char_type.
This doesn't work for type char, and is inconsistent with the
requirements in Table 56, Traits requirements.
Proposed resolution:
Change the signature to
static constexpr int_type not_eof(int_type c);
Bo Persson
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Author: pete@versatilecoding.com (Pete Becker)
Date: Mon, 13 Aug 2007 14:03:28 GMT Raw View
On 2007-08-13 02:16:17 -0400, bop@gmb.dk ("Bo Persson") said:
> The changes made for constexpr in [char.traits.specializations.*] have
> not only changed the not_eof function from pass by const reference to
> pass by value, it has also changed the parameter type from int_type to
> char_type.
>
For what it's worth, that may not have been an intentional change.
N2349, which detailed the changes for adding constant expressions to
the library, has strikeout bars through the "const" and the "&" that
surround the "char_type" argument, but none through "char_type" itself.
So the intention may have been just to change to pass by value, with
text incorrectly copied from the standard.
--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]