mirror of https://github.com/CGAL/cgal
The CGAL_NOEXCEPT macro is no longer needed
This commit is contained in:
parent
9e1a4e7037
commit
0ef8127c71
|
|
@ -389,7 +389,7 @@ namespace CGAL {
|
|||
{}
|
||||
|
||||
/// 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 );
|
||||
if (this->mmap->get_number_of_times_mark_reserved
|
||||
|
|
|
|||
|
|
@ -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>).
|
||||
Any destructor which might throw an exception, including a destructor which
|
||||
uses the `CGAL_destructor_assertion` macro, should be marked with the
|
||||
`CGAL_NOEXCEPT(false)` macro. This macro provides future compatibility with
|
||||
C++11 and above, which provides the `noexcept` keyword.
|
||||
`noexcept(!CGAL_assertions)`.
|
||||
|
||||
\section secchecks_req_and_rec Requirements and recommendations
|
||||
|
||||
|
|
|
|||
|
|
@ -655,12 +655,6 @@ typedef const void * Nullptr_t; // Anticipate C++0x's std::nullptr_t
|
|||
|
||||
} //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
|
||||
// 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
|
||||
#endif
|
||||
|
||||
#ifndef CGAL_NO_ASSERTIONS
|
||||
# define CGAL_NO_ASSERTIONS_BOOL false
|
||||
#else
|
||||
# define CGAL_NO_ASSERTIONS_BOOL true
|
||||
#endif
|
||||
|
||||
#if defined( __INTEL_COMPILER)
|
||||
#define CGAL_ADDITIONAL_VARIANT_FOR_ICL ,int
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -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_destructor_assertion_catch(
|
||||
|
|
@ -1119,7 +1119,7 @@ bool update( Node_handle node,
|
|||
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_destructor_assertion_catch(
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public:
|
|||
|
||||
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("construction_time: "<<ct_t.time());
|
||||
|
|
@ -423,7 +423,7 @@ public:
|
|||
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 ||
|
||||
candidate_provider == 0); // required?
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ public:
|
|||
Sphere_map(bool = false) : boundary_item_(boost::none),
|
||||
svertices_(), sedges_(), sfaces_(), shalfloop_() {}
|
||||
|
||||
~Sphere_map() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL)
|
||||
~Sphere_map() noexcept(!CGAL_assertions)
|
||||
{
|
||||
CGAL_destructor_assertion_catch(
|
||||
clear();
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class Nef_polyhedron_S2_rep {
|
|||
public:
|
||||
Nef_polyhedron_S2_rep() : 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(
|
||||
sm_.clear();
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ public:
|
|||
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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ inline std::ostream& operator << (std::ostream& os, const Exponent_vector& ev) {
|
|||
namespace std{
|
||||
template <> inline
|
||||
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)
|
||||
{
|
||||
ev1.swap(ev2);
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ inline bool possibly(Uncertain<bool> c);
|
|||
// ----------
|
||||
|
||||
#if defined(CGAL_NO_ASSERTIONS)
|
||||
# define CGAL_assertions false
|
||||
# define CGAL_assertion(EX) (static_cast<void>(0))
|
||||
# define CGAL_destructor_assertion(EX) (static_cast<void>(0))
|
||||
# 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)
|
||||
# endif // not def CGAL_ASSUME
|
||||
#else // no CGAL_NO_ASSERTIONS
|
||||
# define CGAL_assertions true
|
||||
# define CGAL_assertion(EX) \
|
||||
(CGAL::possibly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
|
||||
# if __cpp_lib_uncaught_exceptions || ( _MSVC_LANG >= 201703L ) // C++17
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ private:
|
|||
Ref_counted_base& operator=( Ref_counted_base const &);
|
||||
protected:
|
||||
Ref_counted_base(): mCount(0) {}
|
||||
virtual ~Ref_counted_base() CGAL_NOEXCEPT(CGAL_NO_ASSERTIONS_BOOL) {}
|
||||
virtual ~Ref_counted_base() noexcept(!CGAL_assertions) {}
|
||||
public:
|
||||
void AddRef() const { ++mCount; }
|
||||
void Release() const
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ class VRML_2_ostream
|
|||
public:
|
||||
VRML_2_ostream() : m_os(nullptr) {}
|
||||
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(
|
||||
close();
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public:
|
|||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue