From 7fbc85461ba546015c5a684f9d6387c4818f3185 Mon Sep 17 00:00:00 2001 From: David Fields Date: Wed, 8 Jan 2020 11:21:12 -0800 Subject: [PATCH] Implement operator< for winrt::guid --- strings/base_types.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/strings/base_types.h b/strings/base_types.h index 12a9a600e..8bfc2f49c 100644 --- a/strings/base_types.h +++ b/strings/base_types.h @@ -79,13 +79,18 @@ WINRT_EXPORT namespace winrt inline bool operator==(guid const& left, guid const& right) noexcept { - return !memcmp(&left, &right, sizeof(guid)); + return !memcmp(&left, &right, sizeof(left)); } inline bool operator!=(guid const& left, guid const& right) noexcept { return !(left == right); } + + inline bool operator<(guid const& left, guid const& right) noexcept + { + return memcmp(&left, &right, sizeof(left)) < 0; + } } WINRT_EXPORT namespace winrt::Windows::Foundation