diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-09-24 13:55:26 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-09-24 15:42:48 +0300 |
commit | ab9644382d14eb1254ce33e38227c874fd80a08f (patch) | |
tree | 935086c54a7b60d0597fb99330ec292ff118d8eb /source/blender/blenlib/BLI_uuid.h | |
parent | 2b9ca0f112ad41e9402d272cc0c691bd5e1c5956 (diff) |
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.
Diffstat (limited to 'source/blender/blenlib/BLI_uuid.h')
-rw-r--r-- | source/blender/blenlib/BLI_uuid.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_uuid.h b/source/blender/blenlib/BLI_uuid.h index 98a600a5de8..ed0d31b625f 100644 --- a/source/blender/blenlib/BLI_uuid.h +++ b/source/blender/blenlib/BLI_uuid.h @@ -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 |