mirror of https://github.com/AxioDL/metaforce.git
hecl/FourCC: Implement operator!= in terms of operator==
Deduplicates the amount of written code. Now code only needs to ever change in operator== to automatically reflect across the two functions.
This commit is contained in:
parent
06c436b68d
commit
1382bbf365
|
@ -33,15 +33,15 @@ public:
|
|||
constexpr FourCC& operator=(FourCC&&) noexcept = default;
|
||||
|
||||
bool operator==(const FourCC& other) const { return num == other.num; }
|
||||
bool operator!=(const FourCC& other) const { return num != other.num; }
|
||||
bool operator!=(const FourCC& other) const { return !operator==(other); }
|
||||
bool operator==(const char* other) const {
|
||||
return std::memcmp(fcc, other, sizeof(fcc)) == 0;
|
||||
}
|
||||
bool operator!=(const char* other) const { return !operator==(other); }
|
||||
bool operator==(int32_t other) const { return num == uint32_t(other); }
|
||||
bool operator!=(int32_t other) const { return num != uint32_t(other); }
|
||||
bool operator!=(int32_t other) const { return !operator==(other); }
|
||||
bool operator==(uint32_t other) const { return num == other; }
|
||||
bool operator!=(uint32_t other) const { return num != other; }
|
||||
bool operator!=(uint32_t other) const { return !operator==(other); }
|
||||
|
||||
std::string toString() const { return std::string(fcc, 4); }
|
||||
uint32_t toUint32() const { return num; }
|
||||
|
|
Loading…
Reference in New Issue