use initializer list instead of explicit constructor

This commit is contained in:
Axel Kohlmeyer
2021-10-14 01:12:44 -04:00
parent 27145d2789
commit e56cc9be00
4 changed files with 7 additions and 7 deletions

View File

@ -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