use 'noexcept' instead of the deprecated 'throw()'

This commit is contained in:
Axel Kohlmeyer
2021-10-12 21:29:33 -04:00
parent 7b6a3c4307
commit dd6f49a753
4 changed files with 8 additions and 8 deletions

View File

@ -26,9 +26,9 @@ class LAMMPSException : public std::exception {
LAMMPSException(const std::string &msg) : message(msg) {}
~LAMMPSException() throw() {}
~LAMMPSException() noexcept {}
virtual const char *what() const throw() { return message.c_str(); }
virtual const char *what() const noexcept { return message.c_str(); }
};
class LAMMPSAbortException : public LAMMPSException {

View File

@ -39,9 +39,9 @@ class FileWriterException : public std::exception {
public:
FileWriterException(const std::string &msg) : message(msg) {}
~FileWriterException() throw() {}
~FileWriterException() noexcept {}
virtual const char *what() const throw() { return message.c_str(); }
virtual const char *what() const noexcept { return message.c_str(); }
};
} // namespace LAMMPS_NS

View File

@ -52,9 +52,9 @@ class FileReaderException : public std::exception {
public:
FileReaderException(const std::string &msg) : message(msg) {}
~FileReaderException() throw() {}
~FileReaderException() noexcept {}
virtual const char *what() const throw() { return message.c_str(); }
virtual const char *what() const noexcept { return message.c_str(); }
};
class EOFException : public FileReaderException {

View File

@ -62,11 +62,11 @@ class TokenizerException : public std::exception {
* \param token String of the token/word that caused the error */
TokenizerException(const std::string &msg, const std::string &token);
~TokenizerException() throw() {}
~TokenizerException() noexcept {}
/** Retrieve message describing the thrown exception
* \return string with error message */
virtual const char *what() const throw() { return message.c_str(); }
virtual const char *what() const noexcept { return message.c_str(); }
};
class InvalidIntegerException : public TokenizerException {