diff --git a/src/exceptions.h b/src/exceptions.h index 1df6c5d1a3..1c9d8c8daf 100644 --- a/src/exceptions.h +++ b/src/exceptions.h @@ -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 { diff --git a/src/file_writer.h b/src/file_writer.h index 473975d7fe..42e636d16f 100644 --- a/src/file_writer.h +++ b/src/file_writer.h @@ -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 diff --git a/src/text_file_reader.h b/src/text_file_reader.h index 98657a937e..826f470299 100644 --- a/src/text_file_reader.h +++ b/src/text_file_reader.h @@ -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 { diff --git a/src/tokenizer.h b/src/tokenizer.h index 7f45a512dd..ad4f0d3536 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -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 {