From: Daniel Elstner Date: Sun, 11 Oct 2015 10:19:27 +0000 (+0200) Subject: C++: Use noexcept instead of throw() X-Git-Tag: libsigrok-0.4.0~177 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=15914cdb0fc6c4c4e0acd410dd58177d0aa17fd2;p=libsigrok.git C++: Use noexcept instead of throw() Runtime-checked exception specifications via throw() are deprecated in C++11. --- diff --git a/bindings/cxx/classes.cpp b/bindings/cxx/classes.cpp index 25cb60b0..1b53d0a7 100644 --- a/bindings/cxx/classes.cpp +++ b/bindings/cxx/classes.cpp @@ -60,12 +60,12 @@ Error::Error(int result) : result(result) { } -const char *Error::what() const throw() +const char *Error::what() const noexcept { return sr_strerror(result); } -Error::~Error() throw() +Error::~Error() noexcept { } diff --git a/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp b/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp index e93a5fb5..c36ee292 100644 --- a/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp +++ b/bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp @@ -121,9 +121,9 @@ class SR_API Error: public exception { public: explicit Error(int result); - ~Error() throw(); + ~Error() noexcept; const int result; - const char *what() const throw(); + const char *what() const noexcept; }; /* Base template for classes whose resources are owned by a parent object. */