[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: eg <egoots_at_gmail.com>
Date: Wed, 13 Oct 2010 22:38:32 -0700

On 10/13/2010 12:51 PM, Hyrum K. Wright wrote:

>
> At this point, it's my turn to get confused. I'm speaking
> specifically of cases where we return STL classes. Brane's earlier
> suggestion to create an implicit bool conversion works fine for our
> custom classes. The problem I'm trying to solve is "how does one
> return the equivalent of '(const char *) NULL' in an std::string?"
> It's a this point that pointers start coming into play, because a NULL
> std::string * is quite feasible, whereas a NULL std::string isn't.

It may not be of interest, but the Boost::Optional library was designed
as a potential solution to this type of situation.

http://www.boost.org/doc/libs/1_44_0/libs/optional/doc/html/index.html
Received on 2010-10-14 09:32:22 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.