diff --git a/src/common/appstate.cpp b/src/common/appstate.cpp index 2b7231265..125eb31ce 100644 --- a/src/common/appstate.cpp +++ b/src/common/appstate.cpp @@ -228,7 +228,7 @@ namespace lumiera { ExitCode - AppState::abort () throw() + AppState::abort () noexcept { log_and_clear_unexpected_errorstate(); diff --git a/src/common/appstate.hpp b/src/common/appstate.hpp index b68b47f29..2f0d6f6a0 100644 --- a/src/common/appstate.hpp +++ b/src/common/appstate.hpp @@ -125,7 +125,7 @@ namespace lumiera { /** initiate an fatal emergency shutdown, * caused by an unforeseen error condition */ - ExitCode abort () throw(); + ExitCode abort () noexcept; diff --git a/src/common/query/defs-manager-impl.hpp b/src/common/query/defs-manager-impl.hpp index ab4f6f01a..154651db7 100644 --- a/src/common/query/defs-manager-impl.hpp +++ b/src/common/query/defs-manager-impl.hpp @@ -63,7 +63,7 @@ namespace query { /** initialise the most basic internal defaults. */ - DefsManager::DefsManager () throw() + DefsManager::DefsManager () noexcept : defsRegistry_(new DefsRegistry) { TODO ("setup basic technical defaults of the session?"); diff --git a/src/common/query/defs-manager.hpp b/src/common/query/defs-manager.hpp index f941249d1..88e89bf89 100644 --- a/src/common/query/defs-manager.hpp +++ b/src/common/query/defs-manager.hpp @@ -133,7 +133,7 @@ namespace query { public: - DefsManager () throw(); + DefsManager () noexcept; ~DefsManager (); /** common access point: retrieve the default object fulfilling diff --git a/src/lib/allocation-cluster.cpp b/src/lib/allocation-cluster.cpp index 2ca5d89f8..6d37bd96f 100644 --- a/src/lib/allocation-cluster.cpp +++ b/src/lib/allocation-cluster.cpp @@ -194,7 +194,7 @@ namespace lib { * destruction order is maintained by explicitly invoking a cleanup * operation on each of the low-level memory manager objects. */ - AllocationCluster::~AllocationCluster() throw() + AllocationCluster::~AllocationCluster() noexcept { try { // avoiding a per-instance lock for now. diff --git a/src/lib/allocation-cluster.hpp b/src/lib/allocation-cluster.hpp index 1a2928b37..1f393aef6 100644 --- a/src/lib/allocation-cluster.hpp +++ b/src/lib/allocation-cluster.hpp @@ -93,7 +93,7 @@ namespace lib { public: AllocationCluster (); - ~AllocationCluster () throw(); + ~AllocationCluster () noexcept; template diff --git a/src/lib/error-exception.cpp b/src/lib/error-exception.cpp index 2b8bf5cf9..810ba9e6f 100644 --- a/src/lib/error-exception.cpp +++ b/src/lib/error-exception.cpp @@ -58,7 +58,7 @@ namespace lumiera { * @todo to be localised */ inline const string - default_usermsg (Error* exception_obj) throw() + default_usermsg (Error* exception_obj) noexcept { return string("Sorry, Lumiera encountered an internal error. (") + util::typeStr(*exception_obj) + ")"; @@ -109,7 +109,7 @@ namespace lumiera { /** @note we set the C-style errorstate as a side effect */ - Error::Error (string description, CCStr id) throw() + Error::Error (string description, CCStr id) noexcept : std::exception (), id_ (error::default_or_given (id)), msg_ (error::default_usermsg (this)), @@ -121,7 +121,7 @@ namespace lumiera { Error::Error (std::exception const& cause, - string description, CCStr id) throw() + string description, CCStr id) noexcept : std::exception (), id_ (error::default_or_given (id)), msg_ (error::default_usermsg (this)), @@ -133,7 +133,7 @@ namespace lumiera { /** @note copy ctor behaves like chaining, i.e setting the cause_. */ - Error::Error (const Error& ref) throw() + Error::Error (const Error& ref) noexcept : std::exception (), id_ (ref.id_), msg_ (ref.msg_), @@ -149,7 +149,7 @@ namespace lumiera { * generated output as well. */ CStr - Error::what() const throw() + Error::what() const noexcept { if (isnil (this->what_)) { @@ -165,7 +165,7 @@ namespace lumiera { * first exception encountered in a chain of exceptions */ const string - Error::extractCauseMsg (const exception& cause) throw() + Error::extractCauseMsg (const exception& cause) noexcept { const Error* err=dynamic_cast (&cause); if (err) @@ -189,7 +189,7 @@ namespace lumiera { namespace error { - void lumiera_unexpectedException () throw() + void lumiera_unexpectedException () noexcept { CCStr is_halted = "### Lumiera halted due to an unexpected Error ###"; diff --git a/src/lib/error.hpp b/src/lib/error.hpp index 6a8187571..b0ac5ef0f 100644 --- a/src/lib/error.hpp +++ b/src/lib/error.hpp @@ -64,21 +64,21 @@ namespace lumiera { class Error : public std::exception { public: - Error (string description="", const char* const id=LUMIERA_ERROR_EXCEPTION) throw(); + Error (string description="", const char* const id=LUMIERA_ERROR_EXCEPTION) noexcept; Error (std::exception const& cause, - string description="", const char* const id=LUMIERA_ERROR_EXCEPTION) throw(); + string description="", const char* const id=LUMIERA_ERROR_EXCEPTION) noexcept; - Error (const Error&) throw(); - virtual ~Error () throw() {}; + Error (const Error&) noexcept; + virtual ~Error () noexcept {}; /** yield a diagnostic message characterising the problem */ - virtual const char* what () const throw(); + virtual const char* what () const noexcept; /** the internal Lumiera-error-ID (was set as C-errorstate in ctor) */ - const char* getID () const throw() { return this->id_; } + const char* getID () const noexcept { return this->id_; } /** extract the message to be displayed for the user */ - const string& getUsermsg () const throw(); + const string& getUsermsg () const noexcept; /** If this exception was caused by a chain of further exceptions, * return the description of the first one registered in this throw sequence. @@ -86,13 +86,13 @@ namespace lumiera { * is properly constructed by passing the original exception to the constructor * @return the description string, maybe empty (if there is no known root cause) */ - const string& rootCause () const throw() { return this->cause_; } + const string& rootCause () const noexcept { return this->cause_; } /** replace the previous or default friendly message for the user. To be localised. */ - Error& setUsermsg (const string& newMsg) throw() { this->msg_ = newMsg; return *this; } + Error& setUsermsg (const string& newMsg) noexcept { this->msg_ = newMsg; return *this; } /** give additional developer info. Typically used at intermediate handlers to add context. */ - Error& prependInfo (const string& text) throw() { this->desc_.insert (0,text); return *this; } + Error& prependInfo (const string& text) noexcept { this->desc_.insert (0,text); return *this; } private: @@ -102,7 +102,7 @@ namespace lumiera { mutable string what_; ///< buffer for generating the detailed description on demand const string cause_; ///< description of first exception encountered in the chain - static const string extractCauseMsg (std::exception const&) throw(); + static const string extractCauseMsg (std::exception const&) noexcept; }; @@ -120,7 +120,7 @@ namespace lumiera { * can be considered a severe design flaw; we can just * add some diagnostics prior to halting. */ - void lumiera_unexpectedException () throw(); + void lumiera_unexpectedException () noexcept; /** throw an error::Fatal indicating "assertion failure" */ void assertion_terminate (const string& location); @@ -160,12 +160,12 @@ namespace lumiera { { \ public: \ CLASS (std::string description="", \ - const char* id=_ID_) throw() \ + const char* id=_ID_) noexcept \ : PARENT (description, id) {} \ \ CLASS (std::exception const& cause, \ std::string description="", \ - const char* id=_ID_) throw() \ + const char* id=_ID_) noexcept \ : PARENT (cause, description, id) {} \ }; diff --git a/src/lib/ref-array-impl.hpp b/src/lib/ref-array-impl.hpp index b0891b526..a30a0e324 100644 --- a/src/lib/ref-array-impl.hpp +++ b/src/lib/ref-array-impl.hpp @@ -149,7 +149,7 @@ namespace lib { ~RefArrayTable() { cleanup(); } private: - void cleanup(size_t top=n) throw() + void cleanup(size_t top=n) noexcept { while (top) array_[--top].~IM(); } diff --git a/src/proc/asset.cpp b/src/proc/asset.cpp index e2c75276e..0d4ba4ee1 100644 --- a/src/proc/asset.cpp +++ b/src/proc/asset.cpp @@ -140,7 +140,7 @@ namespace asset { /**change the enablement status of this asset. */ bool - Asset::enable (bool on) throw(lumiera::error::State) + Asset::enable (bool on) { if (on == this->enabled) return true; diff --git a/src/proc/asset.hpp b/src/proc/asset.hpp index 8f37faf69..b148a7e0a 100644 --- a/src/proc/asset.hpp +++ b/src/proc/asset.hpp @@ -299,7 +299,7 @@ namespace asset { * @return \c false if the state could not be changed * due to parent objects being disabled */ - bool enable (bool on=true) throw(lumiera::error::State); + bool enable (bool on=true); }; diff --git a/src/proc/mobject/session.hpp b/src/proc/mobject/session.hpp index dfafeac47..add3a7500 100644 --- a/src/proc/mobject/session.hpp +++ b/src/proc/mobject/session.hpp @@ -118,7 +118,7 @@ namespace mobject { Session (DefaultsAccess, ElementsAccess, TimelineAccess, - SequenceAccess) throw(); + SequenceAccess) noexcept; virtual ~Session (); @@ -198,7 +198,7 @@ namespace mobject { * This is the sole access path available for clients. * @note there is no operator* */ - virtual Session* operator-> () throw() =0; + virtual Session* operator-> () noexcept =0; virtual ~SessManager(); }; diff --git a/src/proc/mobject/session/sess-manager-impl.cpp b/src/proc/mobject/session/sess-manager-impl.cpp index 9530936fc..61a98ead7 100644 --- a/src/proc/mobject/session/sess-manager-impl.cpp +++ b/src/proc/mobject/session/sess-manager-impl.cpp @@ -209,7 +209,7 @@ namespace session { * subsystem and the Defaults manager) is created on first * \link #operator-> access \endlink to the session object. */ - SessManagerImpl::SessManagerImpl () throw() + SessManagerImpl::SessManagerImpl () : pSess_{} , lifecycle_{new SessionLifecycleDetails(pSess_)} { diff --git a/src/proc/mobject/session/sess-manager-impl.hpp b/src/proc/mobject/session/sess-manager-impl.hpp index 094d43bd7..27f99cc81 100644 --- a/src/proc/mobject/session/sess-manager-impl.hpp +++ b/src/proc/mobject/session/sess-manager-impl.hpp @@ -65,7 +65,7 @@ namespace session { unique_ptr pSess_; unique_ptr lifecycle_; - SessManagerImpl() throw(); + SessManagerImpl(); friend class lib::DependencyFactory; ~SessManagerImpl() ; diff --git a/src/proc/mobject/session/session.cpp b/src/proc/mobject/session/session.cpp index 58c795bd2..b0e5c9d73 100644 --- a/src/proc/mobject/session/session.cpp +++ b/src/proc/mobject/session/session.cpp @@ -130,7 +130,7 @@ namespace mobject { Session::Session (DefaultsAccess defs ,ElementsAccess quer ,TimelineAccess tils - ,SequenceAccess seqs) throw() + ,SequenceAccess seqs) noexcept : defaults(defs) , elements(quer) , timelines(tils) diff --git a/tests/library/exception-error-test.cpp b/tests/library/exception-error-test.cpp index 0b0d38d0a..d38beed34 100644 --- a/tests/library/exception-error-test.cpp +++ b/tests/library/exception-error-test.cpp @@ -112,7 +112,7 @@ namespace lumiera { * Some levels up, this error get caught and the root cause can be * extracted successfully. */ - void nestedThrower (string msg) throw(Error) + void nestedThrower (string msg) { try { throwExternal(msg); } catch (std::exception& e) @@ -124,7 +124,7 @@ namespace lumiera { } /** @test repeated repackaging and rethrowing */ - void doubleNestedTh (string msg) throw(error::Config) + void doubleNestedTh (string msg) { try { nestedThrower (msg); } catch (Error& e) @@ -208,7 +208,7 @@ namespace lumiera { * @note inside error.hpp, an initialisation hook has been installed into * AppState, causing our own unknown() handler to be installed and * invoked, which gives additional diagnostics.*/ - void terminateUnknown () throw() + void terminateUnknown () noexcept { throw Error("You'll never get me, won't you?"); }