Is it possible to initialize std::stringwithout creating a variable?
What I want to do:
throw std::runtime_error("Error: " + strerror(errno));
What am I doing now:
std::string error = "Error: ";
std::string errmsg(strerror(errno));
throw std::runtime_error(error + errmsg);
source
share