Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3
Chronological Thread
- From: Giles Bathgate <>
- To:
- Subject: Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3
- Date: Fri, 20 Feb 2015 20:58:39 +0000
C++ destructors should never throw exceptions (they should provide the
"nofail" Exception Guarantee).
In the C++ Programming Language (Third Edition)" by Bjarne Stroustrup,
Stroustrup says: "The standard library function uncaught_ exception()
returns true if an exception has been thrown but hasn't yet been
caught. This allows the programmer to specify different actions in a
destructor depending on whether an object is destroyed normally or as
part of stack unwinding." .
try
{
// [ ... ]
}
catch(...)
{
if(std::uncaught_exception() == false)
throw;
}
My patch adds the std::uncaught_exception() check to the standard
CGAL_Assertion macro (for that file only)
This works in standard compilers like GCC , but it is not reported to
work on some deviated ones like some versions of Visual C++.
(sourced from the C2.com wiki)
Regards,
Giles
On 20 February 2015 at 20:01, Marius Kintel
<>
wrote:
> On Feb 20, 2015, at 14:55 PM, Sebastien Loriot (GeometryFactory)
> <>
> wrote:
>> In the meantime you can try:
>> #define CGAL_CT2_WANTS_TO_HAVE_EXTRA_ACTION_FOR_INTERSECTING_CONSTRAINTS
>> #define CGAL_CDT2_EXTRA_ACTION_FOR_INTERSECTING_CONSTRAINTS throw
>> WhatEverException;
>>
>> This will allow you to throw an exception if constraints intersect.
>>
> Not sure that would make a difference. If those defines are not there, the
> default action is "CGAL_triangulation_assertion(false);”
> ..which throws an exception. The presence of this exception is what causes
> the later crash.
>
> My understanding is that what we need is to _not_ throw _any_ exceptions in
> destructors, as that requires a guarantee that no existing exceptions can
> be active. Such a guarantee is probably hard or tedious to maintain.
>
> -Marius
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, kintel, 02/17/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Sebastien Loriot (GeometryFactory), 02/18/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Giles Bathgate, 02/18/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Sebastien Loriot (GeometryFactory), 02/19/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Marius Kintel, 02/20/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Sebastien Loriot (GeometryFactory), 02/20/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Marius Kintel, 02/20/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Giles Bathgate, 02/20/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Sebastien Loriot (GeometryFactory), 02/23/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Giles Bathgate, 02/23/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Marius Kintel, 02/20/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Sebastien Loriot (GeometryFactory), 02/20/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Marius Kintel, 02/20/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Sebastien Loriot (GeometryFactory), 02/19/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Giles Bathgate, 02/18/2015
- Re: [cgal-discuss] Uncatchable exception converting from Nef polyhedron to Polyhedron_3, Sebastien Loriot (GeometryFactory), 02/18/2015
Archive powered by MHonArc 2.6.18.