Add error_code::what

This commit is contained in:
Peter Dimov
2021-10-02 14:41:27 +03:00
parent f2d3a0decf
commit eefcc5dcf6
4 changed files with 110 additions and 0 deletions
@@ -602,6 +602,23 @@ public:
{
return os << ec.to_string();
}
std::string what() const
{
std::string r = message();
r += " [";
r += to_string();
if( has_location() )
{
r += " at ";
r += location().to_string();
}
r += "]";
return r;
}
};
inline std::size_t hash_value( error_code const & ec )