Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > basic_string specialization problem
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 20th January 11:50
gilbert chang
External User
 
Posts: 1
Default basic_string specialization problem


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.

#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;

}
  Reply With Quote


  sponsored links


2 20th January 11:50
erik max francis
External User
 
Posts: 1
Default basic_string specialization problem


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 && max@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
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666