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


Nathan Myers <ncm-nospam@cantrip.org> writes:

| > >As I recall, the standard requires a default definition of
| > >char_traits<T> for any T.  (I recall the vote in favor, which I
| > >opposed, if mildly.)
| > 
| > Yes and no.  There must be a class template std::char_traits<T>
| > (there has to be a primary template to specialize!), but I don't see
| > anything in the standard saying that the primary template has to
| > have any of the members found in table 37.  In fact, I'm not even
| > convinced there's a requirement that the primary template has to
| > be instantiable.
| 
| That was the status quo before the vote.

And also after the vote. 

| > The standard is quite explicit about the member functions in the
| > std::char_traits<char> and std::char_traits<wchar_t> specializations
| > (clauses 21.1.3.1 and 21.1.3.2), but I believe users are entirely on
| > their own if they try to instantiate std::char_traits for any other 
| > types.
| 
| That would mean that the proposal was voted in but never actually
| edited into the standard.  That would be interesting, if true. 

There is an easy way to check ;-)

-- Gaby


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