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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Char_traits (part 2+)


> | typedef unsigned short unicode_type;
> | typedef unsigned char unsigned_type;
> | 
> | then doing
> | 
> | template<> struct std::char_traits<unicode_type>
> | {
> | // do the work
> | }
> | 
> | etc. Isn't this legal?
> 
> No, it isn't.

Ouch. Is it implementation-defined, or illegal? If it's
implementation-defined (or undefined behavior), then can can libstdc++
"define" it to be ok for non-required types (all !(wchar_t || char))?

If not, then I don't see any clear way out of this mess.

> No.  A user-defined type is either a class-type or an enumeration.
> A typedef does not introduce a new type, it just introduces a synonymous
> for a type.

Ok, thanks.


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