diff options
Diffstat (limited to 'src/common')
| -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 { | |||
| 19 | constexpr explicit UUID(const u128& id) : uuid{id} {} | 19 | constexpr explicit UUID(const u128& id) : uuid{id} {} |
| 20 | constexpr explicit UUID(const u64 lo, const u64 hi) : uuid{{lo, hi}} {} | 20 | constexpr explicit UUID(const u64 lo, const u64 hi) : uuid{{lo, hi}} {} |
| 21 | 21 | ||
| 22 | explicit operator bool() const { | 22 | constexpr explicit operator bool() const { |
| 23 | return uuid != INVALID_UUID; | 23 | return uuid[0] != INVALID_UUID[0] && uuid[1] != INVALID_UUID[1]; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | bool operator==(const UUID& rhs) const { | 26 | constexpr bool operator==(const UUID& rhs) const { |
| 27 | return uuid == rhs.uuid; | 27 | // TODO(DarkLordZach): Replace with uuid == rhs.uuid with C++20 |
| 28 | return uuid[0] == rhs.uuid[0] && uuid[1] == rhs.uuid[1]; | ||
| 28 | } | 29 | } |
| 29 | 30 | ||
| 30 | bool operator!=(const UUID& rhs) const { | 31 | constexpr bool operator!=(const UUID& rhs) const { |
| 31 | return !operator==(rhs); | 32 | return !operator==(rhs); |
| 32 | } | 33 | } |
| 33 | 34 | ||