This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Should char_traits<char>::int_type be an int or unsigned long?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]