Browse Source

Added noexcept Destructors to the exceptions to fix the picky Clang3.5 compiler errors.

Former-commit-id: f620e5ed7d
tempestpy_adaptions
PBerger 10 years ago
parent
commit
1cf8674fa5
  1. 4
      src/exceptions/BaseException.cpp
  2. 5
      src/exceptions/BaseException.h
  3. 2
      src/exceptions/ExceptionMacros.h

4
src/exceptions/BaseException.cpp

@ -14,6 +14,10 @@ namespace storm {
stream << cstr;
}
BaseException::~BaseException() {
// Intentionally left empty.
}
const char* BaseException::what() const throw() {
std::string errorString = this->stream.str();
char* result = new char[errorString.size() + 1];

5
src/exceptions/BaseException.h

@ -29,6 +29,11 @@ namespace storm {
*/
BaseException(char const* cstr);
/*!
* Declare a destructor to counter the "looser throw specificator" error
*/
virtual ~BaseException() throw();
/*!
* Retrieves the message associated with this exception.
*

2
src/exceptions/ExceptionMacros.h

@ -13,6 +13,8 @@ exception_name(char const* cstr) : BaseException(cstr) { \
} \
exception_name(exception_name const& cp) : BaseException(cp) { \
} \
~exception_name() throw() { \
} \
template<typename T> \
exception_name& operator<<(T const& var) { \
this->stream << var; \

Loading…
Cancel
Save