[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: object-model: Return by value, reference or pointer? (or something else?)

From: Branko Čibej <brane_at_xbc.nu>
Date: Fri, 15 Oct 2010 11:35:45 +0200

 On 14.10.2010 20:39, Hyrum K. Wright wrote:
> The following is a somewhat naïve implementation, but does it jive
> with your suggestion?

Roughly yes, see the other comment.
On reflection, though, I like the suggestion of returning an
std::pair<std::string, bool>. Make a typedef of that so that users can
declare return-value variables, and use it where it's absolutely
necessary to know that it's not an empty string but a null string. Saves
a lot of trouble with the string subclassing, too. And better than
pulling in 90% of boost just to get a poor-man's replacement for null
references.

-- Brane
Received on 2010-10-15 11:36:27 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.