From 43d0ccdefe9b1e4e3faaa8b465bb7ff7c77c53fa Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Wed, 21 Sep 2022 14:04:01 +0200 Subject: Remove remnants of `throw()` the `throw()` specification has been removed with C++20 and will error out on us. So rather than that, simply use noexcept, as C++03 is thankfully a thing of the past Fixes nvbug3799847 --- thrust/system/detail/bad_alloc.h | 2 +- thrust/system/detail/system_error.inl | 4 ++-- thrust/system/system_error.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/thrust/system/detail/bad_alloc.h b/thrust/system/detail/bad_alloc.h index d568b028..09d17311 100644 --- a/thrust/system/detail/bad_alloc.h +++ b/thrust/system/detail/bad_alloc.h @@ -43,7 +43,7 @@ class bad_alloc inline virtual ~bad_alloc(void) throw () {}; - inline virtual const char *what(void) const throw() + inline virtual const char *what(void) const noexcept { return m_what.c_str(); } // end what() diff --git a/thrust/system/detail/system_error.inl b/thrust/system/detail/system_error.inl index 787bf30d..075fe88e 100644 --- a/thrust/system/detail/system_error.inl +++ b/thrust/system/detail/system_error.inl @@ -76,14 +76,14 @@ system_error const error_code &system_error - ::code(void) const throw() + ::code(void) const noexcept { return m_error_code; } // end system_error::code() const char *system_error - ::what(void) const throw() + ::what(void) const noexcept { if(m_what.empty()) { diff --git a/thrust/system/system_error.h b/thrust/system/system_error.h index cf613933..226ff9b4 100644 --- a/thrust/system/system_error.h +++ b/thrust/system/system_error.h @@ -146,13 +146,13 @@ class system_error * \return ec or error_code(ev, ecat), from the * constructor, as appropriate. */ - inline const error_code &code(void) const throw(); + inline const error_code &code(void) const noexcept; /*! Returns a human-readable string indicating the nature of the error. * \return a string incorporating code().message() and the * arguments supplied in the constructor. */ - inline const char *what(void) const throw(); + inline const char *what(void) const noexcept; /*! \cond */ -- cgit v1.2.3