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: Specializations of std::char_traits


On Wednesday, July 16, 2003, at 8:57AM, B. Kosnik wrote:


(Users can't specialize std::char_traits for fundamental types.)

For this reason, I'm more inclined to provide link-time definitions for
unsigned char/signed char/unsigned short/short, where int_type is pretty
clear. I think this would be a good idea. These would not be in-line but
I think that would be ok. What do you think about this solution?

I think that would be a pretty clean solution. It's not quite what I was
imagining, though: my suggestion was that we provide fully generic
versions, and that we just punt in int_type and the like. That is, we'd
have a char_traits that's just barely enough so that users can write
std::basic_string<int> (or unsigned short, or long long, or whatever)
and that still can't be used for I/O. My guess is that this will meet the
needs of the vast majority of users, that very few people really want
to instantiate std::basic_ostream<int>.


I can send in a patch if you think my description isn't clear enough,
but my feeling is that the two alternatives are both pretty simple.

--matt


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