|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
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<long> lstring; 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 to clearify? Thanks. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On 12ÔÂ28ÈÕ, ÏÂÎç3ʱ24·Ö, "multics.cn" <multics...@gmail.com> wrote:
> 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<long> lstring; > > 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 to > clearify? > > Thanks. what? I am a new user fot this ,SO just try , |
|
![]() |
| Outils de la discussion | |
|
|