diff --git a/src/info.cpp b/src/info.cpp index 3d24f9b56a..41e4e5d63b 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -1011,7 +1011,7 @@ std::vector Info::get_available_styles(const std::string &category) } else if (category == "command") { return get_style_names(input->command_map); } - return std::vector(); + return {}; } template diff --git a/src/molecule.cpp b/src/molecule.cpp index 1a3acf53ba..2c9b03337d 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -2035,7 +2035,7 @@ std::string Molecule::parse_keyword(int flag, char *line) MPI_Bcast(&eof,1,MPI_INT,0,world); if (eof) { - return std::string(""); + return {""}; } // bcast keyword line to all procs diff --git a/src/platform.cpp b/src/platform.cpp index b057c6415b..555026b2ac 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -415,7 +415,7 @@ std::string platform::mpi_info(int &major, int &minor) major = 1; minor = 0; #endif - return std::string(version); + return {version}; } /* ---------------------------------------------------------------------- @@ -543,8 +543,8 @@ void *platform::dlopen(const std::string &fname) std::string platform::dlerror() { const char *errmesg = ::dlerror(); - if (errmesg) return std::string(errmesg); - else return ""; + if (errmesg) return {errmesg}; + else return {""}; } // close a shared object diff --git a/src/utils.cpp b/src/utils.cpp index dab56da8d3..25be3f3b02 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -143,7 +143,7 @@ void utils::fmtargs_logmesg(LAMMPS *lmp, fmt::string_view format, fmt::format_ar std::string utils::getsyserror() { - return std::string(strerror(errno)); + return {strerror(errno)}; } // read line into buffer. if line is too long keep reading until EOL or EOF @@ -738,7 +738,7 @@ std::string utils::trim_comment(const std::string &line) { auto end = line.find_first_of('#'); if (end != std::string::npos) { return line.substr(0, end); } - return std::string(line); + return {line}; } /* ----------------------------------------------------------------------