simple setNull

Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
SergeySlice 2022-04-29 21:20:25 +03:00
parent 1ea4700bd6
commit 60b2ed52b0
2 changed files with 4 additions and 1 deletions

View File

@ -157,6 +157,8 @@
<false/> <false/>
<key>Replace</key> <key>Replace</key>
<data>SU1FSQ==</data> <data>SU1FSQ==</data>
<key>Skip</key>
<integer>0</integer>
</dict> </dict>
</array> </array>
<key>Debug</key> <key>Debug</key>

View File

@ -66,7 +66,8 @@ public:
} }
constexpr bool operator != (const GUID& other) const { return ! (*this == other); } constexpr bool operator != (const GUID& other) const { return ! (*this == other); }
void setNull() { *this = GUID(); } // void setNull() { *this = GUID(); }
void setNull() {Data1 = 0; Data2 = 0; Data3 = 0; memset( (void*)&Data4[0], 0, 8);}
constexpr bool isNull() const { return Data1 == 0 && Data2 == 0 && Data3 == 0 && Data4[0] == 0 && Data4[1] == 0 && Data4[2] == 0 && Data4[3] == 0 && Data4[4] == 0 && Data4[5] == 0 && Data4[6] == 0 && Data4[7] == 0; } constexpr bool isNull() const { return Data1 == 0 && Data2 == 0 && Data3 == 0 && Data4[0] == 0 && Data4[1] == 0 && Data4[2] == 0 && Data4[3] == 0 && Data4[4] == 0 && Data4[5] == 0 && Data4[6] == 0 && Data4[7] == 0; }
constexpr bool notNull() const { return !isNull(); } constexpr bool notNull() const { return !isNull(); }