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+)


Benjamin Kosnik <bkoz@redhat.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.

-- Gaby


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