Skip to content
Snippets Groups Projects
Commit 0d981419 authored by Jesper Andersson's avatar Jesper Andersson
Browse files

changes to exceptions that returned pointer to temporary object

parent 200332df
No related branches found
No related tags found
1 merge request!11changes to exceptions that returned pointer to temporary object
Pipeline #12307 passed
......@@ -39,10 +39,10 @@ class SpMatException: public std::exception
private:
std::string m_msg;
public:
SpMatException(const std::string& msg) throw(): m_msg(msg) {}
SpMatException(const std::string& msg) throw(): m_msg(std::string("SpMat::")+msg) {}
virtual const char * what() const throw() {
return std::string("SpMat::" + m_msg).c_str();
return(m_msg.c_str());
}
~SpMatException() throw() {}
......
......@@ -42,10 +42,10 @@ class BFMatrixException: public std::exception
private:
std::string m_msg;
public:
BFMatrixException(const std::string& msg) throw(): m_msg(msg) {}
BFMatrixException(const std::string& msg) throw(): m_msg(std::string("BFMatrix::")+msg) {}
virtual const char * what() const throw() {
return std::string("BFMatrix::" + m_msg).c_str();
return(m_msg.c_str());
}
~BFMatrixException() throw() {}
......
......@@ -65,10 +65,10 @@ class NonlinException: public std::exception
private:
std::string m_msg;
public:
NonlinException(const std::string& msg) throw(): m_msg(msg) {}
NonlinException(const std::string& msg) throw(): m_msg(std::string("Nonlin: msg=")+msg) {}
virtual const char * what() const throw() {
return std::string("Nonlin: msg=" + m_msg).c_str();
return(m_msg.c_str());
}
~NonlinException() throw() {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment