Commit 087bf895 authored by Dominik Charousset's avatar Dominik Charousset

Simplify/improve to_string for optional<T>

parent 7bd9da72
......@@ -26,6 +26,7 @@
#include "caf/none.hpp"
#include "caf/unit.hpp"
#include "caf/config.hpp"
#include "caf/deep_to_string.hpp"
#include "caf/detail/safe_equal.hpp"
#include "caf/detail/scope_guard.hpp"
......@@ -302,8 +303,8 @@ inspect(Inspector& f, optional<T>& x) {
/// @relates optional
template <class T>
auto to_string(const optional<T>& x) -> decltype(to_string(*x)) {
return x ? "*" + to_string(*x) : "<null>";
std::string to_string(const optional<T>& x) {
return x ? "*" + deep_to_string(*x) : "none";
}
// -- [X.Y.8] comparison with optional ----------------------------------------
......
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