convert Error class to accept 'const std::string &' instead of 'const char *'

This commit is contained in:
Axel Kohlmeyer
2020-06-03 15:43:05 -04:00
parent 9e8ce240a0
commit 9f3f53cc6b
4 changed files with 73 additions and 91 deletions

View File

@ -25,7 +25,7 @@ class LAMMPSException : public std::exception
public:
std::string message;
LAMMPSException(std::string msg) : message(msg) {
LAMMPSException(const std::string &msg) : message(msg) {
}
~LAMMPSException() throw() {
@ -40,7 +40,7 @@ class LAMMPSAbortException : public LAMMPSException {
public:
MPI_Comm universe;
LAMMPSAbortException(std::string msg, MPI_Comm universe) :
LAMMPSAbortException(const std::string &msg, MPI_Comm universe) :
LAMMPSException(msg),
universe(universe)
{