Commit 5dd0b6f2 authored by Dominik Charousset's avatar Dominik Charousset

Implement better to_string for expected<T>

parent 8c635fcd
......@@ -432,9 +432,9 @@ public:
};
template <class T>
auto to_string(const expected<T>& x) -> decltype(to_string(*x)) {
std::string to_string(const expected<T>& x) {
if (x)
return to_string(*x);
return deep_to_string(*x);
return "!" + to_string(x.error());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment