Fix compile error at gcc-13 (Do not use operator< with nullptr) 73/315573/2
authorEunki Hong <eunkiki.hong@samsung.com>
Sat, 3 Aug 2024 12:43:48 +0000 (21:43 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Sat, 3 Aug 2024 13:23:42 +0000 (22:23 +0900)
Change-Id: Ic40ab0752eebbc33f13d1cd7c6f0d14ac424d8c6
Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
dali/public-api/common/intrusive-ptr.h

index 6a43d80e16c13a24cf8cab7f8603a163f9df6e79..4f25ae507a714b4264fa9ef9d6463b552a8d7ba6 100644 (file)
@@ -489,7 +489,8 @@ inline bool operator<(IntrusivePtr<T> const& lhs, U* rhs)
 template<typename T>
 inline bool operator<(std::nullptr_t lhs, IntrusivePtr<T> const& rhs)
 {
-  return nullptr < rhs.Get();
+  // Do not use less operator with nullptr. It will make compile error over gcc-14.
+  return nullptr != rhs.Get();
 }
 
 /**
@@ -503,7 +504,8 @@ inline bool operator<(std::nullptr_t lhs, IntrusivePtr<T> const& rhs)
 template<typename T>
 inline bool operator<(IntrusivePtr<T> const& lhs, std::nullptr_t rhs)
 {
-  return lhs.Get() < nullptr;
+  // Do not use less operator with nullptr. It will make compile error over gcc-14.
+  return false;
 }
 
 /**