Exemplo n.º 1
0
 /// 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;
 }
Exemplo n.º 2
0
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());
}
Exemplo n.º 3
0
value flatten(value const& v) {
  return {flatten(v.data()), flatten(v.type())};
}
Exemplo n.º 4
0
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());
}