コード例 #1
0
ファイル: event.hpp プロジェクト: vast-io/vast
 /// 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;
 }
コード例 #2
0
ファイル: value.cpp プロジェクト: Barba-studio/qpid-proton
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());
}
コード例 #3
0
ファイル: value.cpp プロジェクト: ChallenChenZhiPeng/vast
value flatten(value const& v) {
  return {flatten(v.data()), flatten(v.type())};
}
コード例 #4
0
ファイル: value.cpp プロジェクト: Barba-studio/qpid-proton
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());
}