Gabriel Dos Reis - Re: Char_traits (part 2+) (original) (raw)
This is the mail archive of the libstdc++@gcc.gnu.orgmailing 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] |
- From: Gabriel Dos Reis
- To: Benjamin Kosnik
- Cc: jack_reeves at hotmail dot com, libstdc++ at gcc dot gnu dot org
- Date: 16 Aug 2002 20:42:44 +0200
- Subject: Re: Char_traits (part 2+)
- Organization: CodeSourcery, LLC
- References: <F156GQvnbEG10Gai4om0000075f@hotmail.com> <20020816104914.5b79ec31.bkoz@redhat.com> <m31y8yhdyk.fsf@soliton.integrable-solutions.net> <20020816112732.1ccbc468.bkoz@redhat.com>
Benjamin Kosnik bkoz@redhat.com writes:
| > | typedef unsigned short unicode_type; | > | typedef unsigned char unsigned_type; | > | | > | then doing | > | | > | template<> struct std::char_traits | > | { | > | // do the work | > | } | > | | > | etc. Isn't this legal? | > | > No, it isn't. | | Ouch. Is it implementation-defined, or illegal?
It is undefined-behaviour since unicode_type is not a user-defined type.
| 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))?
That would be a possible extension, but then we should be careful about the meaning we give it.
Sometime ago (one? two years), I was working on the char_traits<> thingy seeking for ways to provide points-of-customization for users -- but I gave up, being distracted by other things (and ironically enough, I ditched the patch from my disk two weeks ago :-(( )
| If not, then I don't see any clear way out of this mess.
Deprecate char_traits<> :-)
Seriously, we may try to define points-of-customization so that the primary template char_traits<> remains useful if some defnitions are provided by users. I don't know how that is better than just telling users that GCC won't reformate their hard drive if they do the specialization -- that however demands more typing.
-- Gaby
- Follow-Ups:
- Re: Char_traits (part 2+)
* From: Matt Austern
- Re: Char_traits (part 2+)
- References:
- Char_traits (part 2+)
* From: Jack Reeves - Re: Char_traits (part 2+)
* From: Benjamin Kosnik - Re: Char_traits (part 2+)
* From: Gabriel Dos Reis - Re: Char_traits (part 2+)
* From: Benjamin Kosnik
- Char_traits (part 2+)
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |