Search Results

Search found 1 results on 1 pages for 'xokmzxoo'.

Page 1/1 | 1 

  • Using operator+ without leaking memory?

    - by xokmzxoo
    So the code in question is this: const String String::operator+ (const String& rhs) { String tmp; tmp.Set(this->mString); tmp.Append(rhs.mString); return tmp; } This of course places the String on the stack and it gets removed and returns garbage. And placing it on the heap would leak memory. So how should I do this?

    Read the article

1