mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 14:13:23 +00:00
Make z3::exception a subclass of std::exception
This commit is contained in:
parent
8973c18856
commit
58f3dce2be
1 changed files with 2 additions and 1 deletions
|
@ -80,11 +80,12 @@ namespace z3 {
|
||||||
/**
|
/**
|
||||||
\brief Exception used to sign API usage errors.
|
\brief Exception used to sign API usage errors.
|
||||||
*/
|
*/
|
||||||
class exception {
|
class exception : public std::exception {
|
||||||
std::string m_msg;
|
std::string m_msg;
|
||||||
public:
|
public:
|
||||||
exception(char const * msg):m_msg(msg) {}
|
exception(char const * msg):m_msg(msg) {}
|
||||||
char const * msg() const { return m_msg.c_str(); }
|
char const * msg() const { return m_msg.c_str(); }
|
||||||
|
char const * what() const noexcept { return m_msg.c_str(); }
|
||||||
friend std::ostream & operator<<(std::ostream & out, exception const & e);
|
friend std::ostream & operator<<(std::ostream & out, exception const & e);
|
||||||
};
|
};
|
||||||
inline std::ostream & operator<<(std::ostream & out, exception const & e) { out << e.msg(); return out; }
|
inline std::ostream & operator<<(std::ostream & out, exception const & e) { out << e.msg(); return out; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue