This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Should char_traits<char>::int_type be an int or unsigned long?
- To: Craig Rodrigues <rodrigc at mediaone dot net>
- Subject: Re: Should char_traits<char>::int_type be an int or unsigned long?
- From: Gabriel Dos Reis <Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr>
- Date: 11 Feb 2001 04:10:03 +0100
- Cc: gcc at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Organization: CMLA, ENS Cachan -- CNRS UMR 8536 (France)
- References: <20010210183641.A30989@mediaone.net>
Craig Rodrigues <rodrigc@mediaone.net> writes:
[...]
| template<class _CharT>
| struct char_traits
| {
| typedef _CharT char_type;
| // Unsigned as wint_t in unsigned.
| typedef unsigned long int_type;
Actually the right place to look at is:
// 21.1.4 char_traits specializations
template<>
struct char_traits<char>
{
typedef char char_type;
typedef unsigned int int_type;
typedef streampos pos_type;
typedef streamoff off_type;
typedef mbstate_t state_type;
But it is broken as well. The Standard says int_type is a typedef for
`int'.
[...]
| What is the correct solution to the problem?
V3 is wrong. Thanks for the bug-report.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com