Index: base/template_util_unittest.cc |
diff --git a/base/template_util_unittest.cc b/base/template_util_unittest.cc |
index 476d6bb7375c70eb13b9fdf23bbef56af0a75e3f..75c47b038716eabda42e3e69bb9ce4240258110f 100644 |
--- a/base/template_util_unittest.cc |
+++ b/base/template_util_unittest.cc |
@@ -6,6 +6,8 @@ |
#include <string> |
+#include "base/containers/flat_tree.h" |
+#include "base/test/move_only_int.h" |
#include "testing/gtest/include/gtest/gtest.h" |
namespace base { |
@@ -91,4 +93,14 @@ static_assert(!base::is_trivially_copyable<TrivialCopyButWithDestructor>::value, |
"trivially copyable"); |
} // namespace |
+ |
+TEST(TemplateUtil, Less) { |
+ using ExplicitInt = base::MoveOnlyInt; |
+ EXPECT_TRUE(base::less()(ExplicitInt(3), 4)); |
+ EXPECT_FALSE(base::less()(4, ExplicitInt(3))); |
+ EXPECT_TRUE(base::less()(3, 4)); |
+ |
+ static_assert(base::internal::IsTransparentCompare<base::less>::value, ""); |
+} |
+ |
} // namespace base |