Specializations of std::char_traits

Gabriel Dos Reis gdr@integrable-solutions.net
Wed Jul 16 21:10:00 GMT 2003


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



More information about the Libstdc++ mailing list