This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: user-defined types and basic_string
- From: Martin Sebor <sebor at roguewave dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 23 Aug 2002 13:07:55 -0600
- Subject: Re: user-defined types and basic_string
- References: <89BE9430-B6C7-11D6-94D6-00039390D9E0@apple.com>
- Reply-to: libstdc++ at gcc dot gnu dot org
Matte Austere wrote:
...
But the biggest problem, I think, is that specializing char_traits is
just a
tiny piece of the work that users need to do to write a new character
type. Seems to me that anyone who's capable of writing a specialization
std::ctype<my_char> is more than capable of writing
std::char_traits<my_char>,
and it'll be a specialization that's right, not just a generic version
that's almost right.
I vote for leaving the generic std::char_traits undefined.
You're probably right if one needs the character type to work with
iostreams. But if all one wants is a basic_string<int> or any other
specialization on a native type besides char and wchar_t, I'd say
the almost right primary template is perfectly adequate.
Martin