/// Type-safe factory function to construct an event from an unchecked value. /// @param v The value to check and convert into an event. /// @returns A valid event according *v* if `v.type().check(v.data())`. static event make(value v) { return type_check(v.type(), v.data()) ? event{std::move(v)} : caf::none; }
bool operator<(const value& x, const value& y) { if (x.empty() && y.empty()) return false; if (x.empty()) return true; // empty is < !empty return x.data().less(y.data()); }
value flatten(value const& v) { return {flatten(v.data()), flatten(v.type())}; }
bool operator==(const value& x, const value& y) { if (x.empty() && y.empty()) return true; if (x.empty() || y.empty()) return false; return x.data().equal(y.data()); }