mirror of https://github.com/AxioDL/metaforce.git
RetroTypes: Make SObjectTag's operator bool explicit
Prevents potentially error-prone implicit conversions to bool.
This commit is contained in:
parent
8176bf75ef
commit
c77153b03c
|
@ -49,7 +49,7 @@ struct SObjectTag {
|
||||||
FourCC type;
|
FourCC type;
|
||||||
CAssetId id;
|
CAssetId id;
|
||||||
|
|
||||||
constexpr operator bool() const noexcept { return id.IsValid(); }
|
constexpr explicit operator bool() const noexcept { return id.IsValid(); }
|
||||||
constexpr bool operator==(const SObjectTag& other) const noexcept { return id == other.id; }
|
constexpr bool operator==(const SObjectTag& other) const noexcept { return id == other.id; }
|
||||||
constexpr bool operator!=(const SObjectTag& other) const noexcept { return !operator==(other); }
|
constexpr bool operator!=(const SObjectTag& other) const noexcept { return !operator==(other); }
|
||||||
constexpr bool operator<(const SObjectTag& other) const noexcept { return id < other.id; }
|
constexpr bool operator<(const SObjectTag& other) const noexcept { return id < other.id; }
|
||||||
|
|
Loading…
Reference in New Issue