[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: Steinar Bang <sb_at_dod.no>
Date: Thu, 14 Oct 2010 21:32:59 +0200

>>>>> Branko Čibej <brane_at_xbc.nu>:

> All right. Then derive svn::string from std::string, and add a .null()
> method. You get to use all the standard string alogorithm
> specializations, plus you get what you want.

There is one known objection to this: std::string doesn't have a virtual
destructor, so if you hand a pointer to your derived string off to
something that holds a std::string* and then do delete on that
std::string* you enter into "undefined behaviour" territory.

Meaning what happens isn't defined, and different compilers can
do... interesting things.
Received on 2010-10-14 21:33:48 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.