UUID: add less-than operator

Add `operator<` to C++ class to allow lexicographic ordering of UUIDs.

This will be necessary when writing asset catalogs to disk in a predictable
(i.e. ordered) manner.
This commit is contained in:
2021-09-24 12:55:26 +02:00
parent 2b9ca0f112
commit ab9644382d
3 changed files with 47 additions and 0 deletions

View File

@@ -98,6 +98,11 @@ class bUUID : public ::bUUID {
bool operator==(bUUID uuid1, bUUID uuid2);
bool operator!=(bUUID uuid1, bUUID uuid2);
/**
* Lexicographic comparison of the UUIDs.
* Equivalent to string comparison on the formatted UUIDs. */
bool operator<(bUUID uuid1, bUUID uuid2);
} // namespace blender
#endif