This is the mail archive of the
mailing list for the libstdc++ project.
Re: Char_traits (part 2+)
Benjamin Kosnik <email@example.com> writes:
| I guess I was thinking more of something like
| 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.
| Aren't these user-defined types, and thus allowed
| to do the specialization of std::char_traits?
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.