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: user-defined types and basic_string


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


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