[geos-devel] Making exceptions inherit from std::exception

strk at refractions.net strk at refractions.net
Fri Mar 11 02:04:16 EST 2005


On Thu, Mar 10, 2005 at 04:22:34PM -0500, Mark Coletti wrote:
> On Thu, 10 Mar 2005 09:50:59 +0100, strk at refractions.net
> <strk at refractions.net> wrote:
> > Mark, thanks for the contribution. I've been thinking about this
> > since the beginning, but changing it would mean another big break
> > of the API :(.
> 
> Not really.  I only had to add the throw() qualifiers throughout the
> Exception hierarchy; I already did that work for you.  You can use a
> patch utility to apply my changes.

Sorry, I only read your mail, not your patch. Now I see...

> > We are probably going to break it anyway before next release so
> > I'd apply it nonetheless. Note though, that the patch lacks modification
> > of actual throws, as all GEOSexceptions (the Base class) are thrown by
> > pointer, not by reference, as the std::exception are.
> 
> Is there a reason to throw exceptions in this way?  Didn't Scott
> Meyers have something to say about that in _Effective C++_?  (Sorry,
> don't have my copy handy here at work.)

I don't know who Scott Meyers is, anyway I understand myself that 
throwing by pointer has been a *wrong* decision. I didn't take it,
and taking it now would be problematic for current users.

--strk;

> 
> Cheers!
> 
> Mark
> -- 
> I'm taking reality in small doses to build immunity.
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel



More information about the geos-devel mailing list