By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,408 Members | 1,840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,408 IT Pros & Developers. It's quick & easy.

char_traits of user defined "char" type

P: n/a
Good day, c++ guys.

I have a question about char_traits of user defined "char" type. I
need a string type, which supports "long" as its "char" type, so I
defined a lstring like this:

typedef basic_string<longlstring;

but I did not define template <char_traits<long{...};
It seems following code works:

lstring aLongString;
int aLongString.length();

I do not quite understand the roll of char_traits, can anyone help to
clearify?

Thanks.
Dec 28 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On 12月28日, 下午3时24分, "multics.cn" <multics...@gmail.comwrote:
Good day, c++ guys.

I have a question about char_traits of user defined "char" type. I
need a string type, which supports "long" as its "char" type, so I
defined a lstring like this:

typedef basic_string<longlstring;

but I did not define template <char_traits<long{...};
It seems following code works:

lstring aLongString;
int aLongString.length();

I do not quite understand the roll of char_traits, can anyone help to
clearify?

Thanks.
what? I am a new user fot this ,SO just try ,
Dec 28 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.