diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-12-27 20:54:44 -0500 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-04-25 08:07:57 -0400 |
commit | 1aa2b99a982e83022c9aae23c6a47eae119d21a4 (patch) | |
tree | 33f5c35625557c73998d48ca8f0d26dd0f986d84 /src/common/uuid.h | |
parent | c40cff454d0b4af1c14cafe11ca7372be8ccbd11 (diff) |
mii: Implement Delete and Destroy file
Diffstat (limited to 'src/common/uuid.h')
-rw-r--r-- | src/common/uuid.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/common/uuid.h b/src/common/uuid.h index b8864b34f..f6ad064fb 100644 --- a/src/common/uuid.h +++ b/src/common/uuid.h @@ -19,15 +19,16 @@ struct UUID { constexpr explicit UUID(const u128& id) : uuid{id} {} constexpr explicit UUID(const u64 lo, const u64 hi) : uuid{{lo, hi}} {} - explicit operator bool() const { - return uuid != INVALID_UUID; + constexpr explicit operator bool() const { + return uuid[0] != INVALID_UUID[0] && uuid[1] != INVALID_UUID[1]; } - bool operator==(const UUID& rhs) const { - return uuid == rhs.uuid; + constexpr bool operator==(const UUID& rhs) const { + // TODO(DarkLordZach): Replace with uuid == rhs.uuid with C++20 + return uuid[0] == rhs.uuid[0] && uuid[1] == rhs.uuid[1]; } - bool operator!=(const UUID& rhs) const { + constexpr bool operator!=(const UUID& rhs) const { return !operator==(rhs); } |