diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-09-24 08:02:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-24 08:02:11 -0400 |
commit | c8512839d78249a441a354a4072779c982fd4305 (patch) | |
tree | 7fa0f1fa088cc3c96903381967542317b5f914d7 /src/common/uuid.h | |
parent | 4baef7905e88fae7a3486d24bf7a111ad4d30b8a (diff) | |
parent | 091e1411422c62ef358c8d3750a92735858b1a61 (diff) |
Merge pull request #7069 from lioncash/uuid
common/uuid: Add validity checking functions to interface
Diffstat (limited to 'src/common/uuid.h')
-rw-r--r-- | src/common/uuid.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/uuid.h b/src/common/uuid.h index 2353179d8..8ea01f8da 100644 --- a/src/common/uuid.h +++ b/src/common/uuid.h @@ -58,6 +58,13 @@ struct UUID { uuid = INVALID_UUID; } + [[nodiscard]] constexpr bool IsInvalid() const { + return uuid == INVALID_UUID; + } + [[nodiscard]] constexpr bool IsValid() const { + return !IsInvalid(); + } + // TODO(ogniK): Properly generate a Nintendo ID [[nodiscard]] constexpr u64 GetNintendoID() const { return uuid[0]; |