realbasic-plugins
[Top] [All Lists]

Re: c++ class return

To: REALbasic Plugins <realbasic-plugins at lists dot realsoftware dot com>
Subject: Re: c++ class return
From: Will Leshner <leshner at ljug dot com>
Date: Fri, 20 May 2005 09:25:44 -0700
Delivered-to: realbasic-plugins at lists dot realsoftware dot com
References: <a5069edafc9d2be32f65474a8fa5076f at elfdata dot com>

On May 20, 2005, at 9:02 AM, Theodore H.Smith wrote:

I know that this is actually a pointer being returned, even if it looks like a whole object... but C++'s string class does some fancy stuff with operators and I was wondering if maybe the class actually gets copied on return instead of just returning a pointer to something that already got disposed when the stack returned.

If it's strings, just return them, not a reference to them. Any decent STL implementation is going to refcount strings anyway.

--
REALbasic database options: http://sqlabs.net
REALbasic news and tips: http://rbgazette.com
KidzMail & KidzLog: http://haranbanjo.com

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>