The CGAL_NOEXCEPT macro is no longer needed

This commit is contained in:
Giles Bathgate 2021-04-20 20:20:58 +01:00
parent 9e1a4e7037
commit 0ef8127c71
13 changed files with 15 additions and 26 deletions

View File

@ -389,7 +389,7 @@ namespace CGAL {
{} {}
/// Destructor. /// Destructor.
~CMap_non_basic_iterator() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) ~CMap_non_basic_iterator() noexcept(!CGAL_assertions)
{ {
CGAL_destructor_assertion( this->mmark_number!=Map::INVALID_MARK ); CGAL_destructor_assertion( this->mmark_number!=Map::INVALID_MARK );
if (this->mmap->get_number_of_times_mark_reserved if (this->mmap->get_number_of_times_mark_reserved

View File

@ -243,8 +243,7 @@ and \cgalCite{cgal:a-esgc-98} (also available at
<A HREF="https://www.boost.org/community/exception_safety.html"><TT>https://www.boost.org/community/exception_safety.html</TT></A>). <A HREF="https://www.boost.org/community/exception_safety.html"><TT>https://www.boost.org/community/exception_safety.html</TT></A>).
Any destructor which might throw an exception, including a destructor which Any destructor which might throw an exception, including a destructor which
uses the `CGAL_destructor_assertion` macro, should be marked with the uses the `CGAL_destructor_assertion` macro, should be marked with the
`CGAL_NOEXCEPT(false)` macro. This macro provides future compatibility with `noexcept(!CGAL_assertions)`.
C++11 and above, which provides the `noexcept` keyword.
\section secchecks_req_and_rec Requirements and recommendations \section secchecks_req_and_rec Requirements and recommendations

View File

@ -655,12 +655,6 @@ typedef const void * Nullptr_t; // Anticipate C++0x's std::nullptr_t
} //namespace CGAL } //namespace CGAL
//Support for c++11 noexcept
#if BOOST_VERSION > 104600 && !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_NOEXCEPT)
#define CGAL_NOEXCEPT(x) noexcept(x)
#else
#define CGAL_NOEXCEPT(x)
#endif
// The fallthrough attribute // The fallthrough attribute
// See for clang: // See for clang:
@ -684,12 +678,6 @@ typedef const void * Nullptr_t; // Anticipate C++0x's std::nullptr_t
#define CGAL_CFG_BOOST_VARIANT_SWAP_BUG 1 #define CGAL_CFG_BOOST_VARIANT_SWAP_BUG 1
#endif #endif
#ifndef CGAL_NO_ASSERTIONS
# define CGAL_NO_ASSERTIONS_BOOL false
#else
# define CGAL_NO_ASSERTIONS_BOOL true
#endif
#if defined( __INTEL_COMPILER) #if defined( __INTEL_COMPILER)
#define CGAL_ADDITIONAL_VARIANT_FOR_ICL ,int #define CGAL_ADDITIONAL_VARIANT_FOR_ICL ,int
#else #else

View File

@ -445,7 +445,7 @@ friend std::ostream& operator<<
} }
/* /*
~Node() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) ~Node() noexcept(!CGAL_assertions)
{ {
CGAL_NEF_TRACEN("~Node: deleting node..."); CGAL_NEF_TRACEN("~Node: deleting node...");
CGAL_destructor_assertion_catch( CGAL_destructor_assertion_catch(
@ -1119,7 +1119,7 @@ bool update( Node_handle node,
return (left_updated || right_updated); return (left_updated || right_updated);
} }
/* /*
~K3_tree() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) ~K3_tree() noexcept(!CGAL_assertions)
{ {
CGAL_NEF_TRACEN("~K3_tree: deleting root..."); CGAL_NEF_TRACEN("~K3_tree: deleting root...");
CGAL_destructor_assertion_catch( CGAL_destructor_assertion_catch(

View File

@ -126,7 +126,7 @@ public:
virtual void add_vertex(Vertex_handle) {} virtual void add_vertex(Vertex_handle) {}
virtual ~SNC_point_locator() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) virtual ~SNC_point_locator() noexcept(!CGAL_assertions)
{ {
CGAL_NEF_CLOG(""); CGAL_NEF_CLOG("");
CGAL_NEF_CLOG("construction_time: "<<ct_t.time()); CGAL_NEF_CLOG("construction_time: "<<ct_t.time());
@ -423,7 +423,7 @@ public:
return updated; return updated;
} }
virtual ~SNC_point_locator_by_spatial_subdivision() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) virtual ~SNC_point_locator_by_spatial_subdivision() noexcept(!CGAL_assertions)
{ {
CGAL_destructor_warning(initialized || CGAL_destructor_warning(initialized ||
candidate_provider == 0); // required? candidate_provider == 0); // required?

View File

@ -229,7 +229,7 @@ public:
Sphere_map(bool = false) : boundary_item_(boost::none), Sphere_map(bool = false) : boundary_item_(boost::none),
svertices_(), sedges_(), sfaces_(), shalfloop_() {} svertices_(), sedges_(), sfaces_(), shalfloop_() {}
~Sphere_map() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) ~Sphere_map() noexcept(!CGAL_assertions)
{ {
CGAL_destructor_assertion_catch( CGAL_destructor_assertion_catch(
clear(); clear();

View File

@ -73,7 +73,7 @@ class Nef_polyhedron_S2_rep {
public: public:
Nef_polyhedron_S2_rep() : sm_() {} Nef_polyhedron_S2_rep() : sm_() {}
Nef_polyhedron_S2_rep(const Self&) : sm_() {} Nef_polyhedron_S2_rep(const Self&) : sm_() {}
~Nef_polyhedron_S2_rep() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) ~Nef_polyhedron_S2_rep() noexcept(!CGAL_assertions)
{ {
CGAL_destructor_assertion_catch( CGAL_destructor_assertion_catch(
sm_.clear(); sm_.clear();

View File

@ -191,7 +191,7 @@ public:
CGAL_assertion_code(check_protocoll = 0;) CGAL_assertion_code(check_protocoll = 0;)
} }
~Polyhedron_incremental_builder_3() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) ~Polyhedron_incremental_builder_3() noexcept(!CGAL_assertions)
{ {
CGAL_destructor_assertion( check_protocoll == 0); CGAL_destructor_assertion( check_protocoll == 0);
} }

View File

@ -161,7 +161,7 @@ inline std::ostream& operator << (std::ostream& os, const Exponent_vector& ev) {
namespace std{ namespace std{
template <> inline template <> inline
void swap(CGAL::Exponent_vector& ev1, CGAL::Exponent_vector& ev2) void swap(CGAL::Exponent_vector& ev1, CGAL::Exponent_vector& ev2)
CGAL_NOEXCEPT(std::is_nothrow_move_constructible<CGAL::Exponent_vector>::value noexcept(std::is_nothrow_move_constructible<CGAL::Exponent_vector>::value
&& std::is_nothrow_move_assignable<CGAL::Exponent_vector>::value) && std::is_nothrow_move_assignable<CGAL::Exponent_vector>::value)
{ {
ev1.swap(ev2); ev1.swap(ev2);

View File

@ -77,6 +77,7 @@ inline bool possibly(Uncertain<bool> c);
// ---------- // ----------
#if defined(CGAL_NO_ASSERTIONS) #if defined(CGAL_NO_ASSERTIONS)
# define CGAL_assertions false
# define CGAL_assertion(EX) (static_cast<void>(0)) # define CGAL_assertion(EX) (static_cast<void>(0))
# define CGAL_destructor_assertion(EX) (static_cast<void>(0)) # define CGAL_destructor_assertion(EX) (static_cast<void>(0))
# define CGAL_destructor_assertion_catch(CODE) CODE # define CGAL_destructor_assertion_catch(CODE) CODE
@ -90,6 +91,7 @@ inline bool possibly(Uncertain<bool> c);
# define CGAL_assume_code(CODE) CGAL_assertion_code(CODE) # define CGAL_assume_code(CODE) CGAL_assertion_code(CODE)
# endif // not def CGAL_ASSUME # endif // not def CGAL_ASSUME
#else // no CGAL_NO_ASSERTIONS #else // no CGAL_NO_ASSERTIONS
# define CGAL_assertions true
# define CGAL_assertion(EX) \ # define CGAL_assertion(EX) \
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__)) (CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
# if __cpp_lib_uncaught_exceptions || ( _MSVC_LANG >= 201703L ) // C++17 # if __cpp_lib_uncaught_exceptions || ( _MSVC_LANG >= 201703L ) // C++17

View File

@ -164,7 +164,7 @@ private:
Ref_counted_base& operator=( Ref_counted_base const &); Ref_counted_base& operator=( Ref_counted_base const &);
protected: protected:
Ref_counted_base(): mCount(0) {} Ref_counted_base(): mCount(0) {}
virtual ~Ref_counted_base() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) {} virtual ~Ref_counted_base() noexcept(!CGAL_assertions) {}
public: public:
void AddRef() const { ++mCount; } void AddRef() const { ++mCount; }
void Release() const void Release() const

View File

@ -30,7 +30,7 @@ class VRML_2_ostream
public: public:
VRML_2_ostream() : m_os(nullptr) {} VRML_2_ostream() : m_os(nullptr) {}
VRML_2_ostream(std::ostream& o) : m_os(&o) { header(); } VRML_2_ostream(std::ostream& o) : m_os(&o) { header(); }
~VRML_2_ostream() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) ~VRML_2_ostream() noexcept(!CGAL_assertions)
{ {
CGAL_destructor_assertion_catch( CGAL_destructor_assertion_catch(
close(); close();

View File

@ -175,7 +175,7 @@ public:
CGAL_assertion_code(check_protocoll = 0;) CGAL_assertion_code(check_protocoll = 0;)
} }
~Enriched_polyhedron_incremental_builder_3() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) ~Enriched_polyhedron_incremental_builder_3() noexcept(!CGAL_assertions)
{ {
CGAL_destructor_assertion( check_protocoll == 0); CGAL_destructor_assertion( check_protocoll == 0);
} }