#include <string>
typedef unsigned short Chr;
typedef std::basic_string<Chr, std::char_traits<Chr>, std::allocator<Chr> >
ustring;
int main(void) {
unsigned short c = 0x1234;
ustring s(&c);
ustring s2 = s;
}
> The standard C++ library does not seem to pre-instantiate the
> basic_string
> specialization with unsigned short. I couldn't manually get g++ to
> instantiate it either. The problem can be reproduced with the
> following
> code. This is with g++ v3.2. Any idea? Thanks.
Why do you think it should? The reason traits and allocators exist is
precisely so that you can define those things yourself. If you want
something other than std::basic_string<char> or
std::basic_string<wchar_t>, you're going to have to define the traits
yourself.
--
Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/
__ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/ \ Don't want you to leave / And I don't want to leave you
\__/ Chante Moore