Re: String and std::string

2003-03-21 Thread William A. Hoffman
I think you are confusing strstream with string. With strstream if you call .str(), you must call delete on the string, or call freeze(0). I have never seen a problem with g++ and string .c_str() leaking memory. -Bill At 08:08 AM 3/21/2003, Pavel Tsekov wrote: >On 21 Mar 2003, Robert Collins

Re: String and std::string

2003-03-21 Thread Pavel Tsekov
On 21 Mar 2003, Robert Collins wrote: > this may well. Look in the g++ library for freeze() (again, IIRC). The > thing I saw when I was reading the source, was that the internal buffer > was not delete[]'d once it was handed out via c_str(). That was with the > libstc++ for gcc 2.95 as well. I've

RE: String and std::string

2003-03-21 Thread Morrison, John
Robert Collins wrote: > On Fri, 2003-03-21 at 23:12, Alex Tibbles wrote: >> >> >>> I don't care whether you use std::string, or >>> String++ for any new code, >>> as long as: >>> 1) You don't leak memory (std::string will leak if >>> you use c_str()) >>> IIRC. >> >> I've been unable to confirm t

Re: String and std::string

2003-03-21 Thread Robert Collins
On Fri, 2003-03-21 at 23:12, Alex Tibbles wrote: > > > > I don't care whether you use std::string, or > > String++ for any new code, > > as long as: > > 1) You don't leak memory (std::string will leak if > > you use c_str()) > > IIRC. > > I've been unable to confirm this. I tried the attached >

Re: String and std::string

2003-03-21 Thread Pavel Tsekov
On Fri, 21 Mar 2003, Alex Tibbles wrote: > > I don't care whether you use std::string, or > > String++ for any new code, > > as long as: > > 1) You don't leak memory (std::string will leak if > > you use c_str()) > > IIRC. > > I've been unable to confirm this. I tried the attached > program (comp

Re: String and std::string

2003-03-21 Thread Alex Tibbles
> I don't care whether you use std::string, or > String++ for any new code, > as long as: > 1) You don't leak memory (std::string will leak if > you use c_str()) > IIRC. I've been unable to confirm this. I tried the attached program (compiled with gcc -lstdc++ stringleak.cpp) and got the followi

Re: String and std::string

2003-03-16 Thread Robert Collins
gt; > Is one of String and std::string deprecated as far as setup is concerned? > > Are there any features String has but std::string does not? > > Should I add the needed functionality to String, or convert all relevant > parts of setup away from String, to std::string? libgeto

Re: String and std::string

2003-03-16 Thread Max Bowsher
Pavel Tsekov wrote: > On Sun, 16 Mar 2003, Max Bowsher wrote: > Are there any features String has but std::string does not? >>> >>> Except for casecompare() I think not. Of course you can perform >>> caseless comparison with std::string. It's just a bit tricky :). >>> Hint: char_traits. >> >>

Re: String and std::string

2003-03-16 Thread Pavel Tsekov
On Sun, 16 Mar 2003, Max Bowsher wrote: > >> Are there any features String has but std::string does not? > > > > Except for casecompare() I think not. Of course you can perform > > caseless comparison with std::string. It's just a bit tricky :). > > Hint: char_traits. > > What fun. I think it's

Re: String and std::string

2003-03-16 Thread Max Bowsher
>> has the necessary functionality. >> >> Is one of String and std::string deprecated as far as setup is >> concerned? >> >> Are there any features String has but std::string does not? > > Except for casecompare() I think not. Of course you can perf

Re: String and std::string

2003-03-16 Thread Pavel Tsekov
On Sun, 16 Mar 2003, Max Bowsher wrote: > I've been toying with some ideas for UserSetting persistence in setup.conf, > and have run into the following issue: > > String, from String++.* lacks some functionality I need. std::string has the > necessary functionality. > >

String and std::string

2003-03-16 Thread Max Bowsher
I've been toying with some ideas for UserSetting persistence in setup.conf, and have run into the following issue: String, from String++.* lacks some functionality I need. std::string has the necessary functionality. Is one of String and std::string deprecated as far as setup is concerned?