diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-12-28 02:54:44 +0100 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2019-04-25 14:07:57 +0200 |
commit | 1aa2b99a982e83022c9aae23c6a47eae119d21a4 (patch) | |
tree | 33f5c35625557c73998d48ca8f0d26dd0f986d84 /src/common/uuid.h | |
parent | mii: Implement IsUpdated command (IPC 0) (diff) | |
download | yuzu-1aa2b99a982e83022c9aae23c6a47eae119d21a4.tar yuzu-1aa2b99a982e83022c9aae23c6a47eae119d21a4.tar.gz yuzu-1aa2b99a982e83022c9aae23c6a47eae119d21a4.tar.bz2 yuzu-1aa2b99a982e83022c9aae23c6a47eae119d21a4.tar.lz yuzu-1aa2b99a982e83022c9aae23c6a47eae119d21a4.tar.xz yuzu-1aa2b99a982e83022c9aae23c6a47eae119d21a4.tar.zst yuzu-1aa2b99a982e83022c9aae23c6a47eae119d21a4.zip |
Diffstat (limited to '')
-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); } |