This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: why so


On Sun, Mar 8, 2009 at 7:21 PM, Paul Pluzhnikov <ppluzhnikov@google.com> wrote:
> On Sun, Mar 8, 2009 at 6:12 AM, Uladzislau Rezki <urezki@gmail.com> wrote:
>
>> I am stuck with debugging C++ application that uses STL.
>> So, i have a simple code:
>>
>> #include <iostream>
>>
>> static int
>> test(std::string s)
>
> Note that passing strings by value is very inefficient.
> You should probably pass 'const string &' instead, and this will
> also cure the glitch you are observing.
>
If i pass "std::string &s', everything will work in my case and i see normal
string, this issue happens just in case 'std::string s'.

Thanks for your answer.

--
Uladzislau Rezki


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]