[PATCH] D108733: Use std::less instead of operator < in less_first and less_second

Akira Hatanaka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 27 12:59:57 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG8f859cc34966: Use std::less instead of operator < in less_first and less_second (authored by ahatanak).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108733/new/

https://reviews.llvm.org/D108733

Files:
  llvm/include/llvm/ADT/STLExtras.h


Index: llvm/include/llvm/ADT/STLExtras.h
===================================================================
--- llvm/include/llvm/ADT/STLExtras.h
+++ llvm/include/llvm/ADT/STLExtras.h
@@ -1273,7 +1273,7 @@
 /// compares less than the first component of another std::pair.
 struct less_first {
   template <typename T> bool operator()(const T &lhs, const T &rhs) const {
-    return lhs.first < rhs.first;
+    return std::less<>()(lhs.first, rhs.first);
   }
 };
 
@@ -1281,7 +1281,7 @@
 /// compares less than the second component of another std::pair.
 struct less_second {
   template <typename T> bool operator()(const T &lhs, const T &rhs) const {
-    return lhs.second < rhs.second;
+    return std::less<>()(lhs.second, rhs.second);
   }
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108733.369165.patch
Type: text/x-patch
Size: 753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210827/277124e2/attachment.bin>


More information about the llvm-commits mailing list