summaryrefslogtreecommitdiff
path: root/src/base/exception.h
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2018-01-09 22:05:02 -0800
committerAndres Noetzli <andres.noetzli@gmail.com>2018-01-09 22:05:02 -0800
commit2e5cc613d280fab1be89d8360250cbc3a1635ac9 (patch)
treeced7d813eec67a32fd3f1b4a1174f5ff00ab1767 /src/base/exception.h
parentff9d2c84dae5eb21a7ef77f5931673fb23129730 (diff)
Cleaning up throw specifiers on Exception and subclasses. (#1475)
Diffstat (limited to 'src/base/exception.h')
-rw-r--r--src/base/exception.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/base/exception.h b/src/base/exception.h
index 01a054b19..04b155571 100644
--- a/src/base/exception.h
+++ b/src/base/exception.h
@@ -32,24 +32,24 @@
namespace CVC4 {
class CVC4_PUBLIC Exception : public std::exception {
-protected:
+ protected:
std::string d_msg;
-public:
+ public:
// Constructors
- Exception() throw() : d_msg("Unknown exception") {}
- Exception(const std::string& msg) throw() : d_msg(msg) {}
- Exception(const char* msg) throw() : d_msg(msg) {}
+ Exception() : d_msg("Unknown exception") {}
+ Exception(const std::string& msg) : d_msg(msg) {}
+ Exception(const char* msg) : d_msg(msg) {}
// Destructor
- virtual ~Exception() throw() {}
+ virtual ~Exception() {}
// NON-VIRTUAL METHOD for setting and printing the error message
- void setMessage(const std::string& msg) throw() { d_msg = msg; }
- std::string getMessage() const throw() { return d_msg; }
+ void setMessage(const std::string& msg) { d_msg = msg; }
+ std::string getMessage() const { return d_msg; }
// overridden from base class std::exception
- virtual const char* what() const throw() { return d_msg.c_str(); }
+ const char* what() const noexcept override { return d_msg.c_str(); }
/**
* Get this exception as a string. Note that
@@ -63,7 +63,8 @@ public:
* toString(), there is no stream, so the parameters are default
* and you'll get exprs and types printed using the AST language.
*/
- std::string toString() const throw() {
+ std::string toString() const
+ {
std::stringstream ss;
toStream(ss);
return ss.str();
@@ -74,7 +75,7 @@ public:
* a derived class, it's recommended that this method print the
* type of exception before the actual message.
*/
- virtual void toStream(std::ostream& os) const throw() { os << d_msg; }
+ virtual void toStream(std::ostream& os) const { os << d_msg; }
};/* class Exception */
@@ -116,8 +117,10 @@ public:
static std::string formatVariadic(const char* format, ...);
};/* class IllegalArgumentException */
-inline std::ostream& operator<<(std::ostream& os, const Exception& e) throw() CVC4_PUBLIC;
-inline std::ostream& operator<<(std::ostream& os, const Exception& e) throw() {
+inline std::ostream& operator<<(std::ostream& os,
+ const Exception& e) CVC4_PUBLIC;
+inline std::ostream& operator<<(std::ostream& os, const Exception& e)
+{
e.toStream(os);
return os;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback