about summary refs log tree commit diff
path: root/absl/types/compare.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/types/compare.h')
-rw-r--r--absl/types/compare.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/absl/types/compare.h b/absl/types/compare.h
index c29ced5273a2..62ca70f9a704 100644
--- a/absl/types/compare.h
+++ b/absl/types/compare.h
@@ -176,6 +176,14 @@ class weak_equality
                                    weak_equality v) noexcept {
     return 0 != v.value_;
   }
+  friend constexpr bool operator==(weak_equality v1,
+                                   weak_equality v2) noexcept {
+    return v1.value_ == v2.value_;
+  }
+  friend constexpr bool operator!=(weak_equality v1,
+                                   weak_equality v2) noexcept {
+    return v1.value_ != v2.value_;
+  }
 
  private:
   compare_internal::value_type value_;
@@ -219,6 +227,14 @@ class strong_equality
                                    strong_equality v) noexcept {
     return 0 != v.value_;
   }
+  friend constexpr bool operator==(strong_equality v1,
+                                   strong_equality v2) noexcept {
+    return v1.value_ == v2.value_;
+  }
+  friend constexpr bool operator!=(strong_equality v1,
+                                   strong_equality v2) noexcept {
+    return v1.value_ != v2.value_;
+  }
 
  private:
   compare_internal::value_type value_;
@@ -306,6 +322,14 @@ class partial_ordering
                                    partial_ordering v) noexcept {
     return v.is_ordered() && 0 >= v.value_;
   }
+  friend constexpr bool operator==(partial_ordering v1,
+                                   partial_ordering v2) noexcept {
+    return v1.value_ == v2.value_;
+  }
+  friend constexpr bool operator!=(partial_ordering v1,
+                                   partial_ordering v2) noexcept {
+    return v1.value_ != v2.value_;
+  }
 
  private:
   compare_internal::value_type value_;
@@ -390,6 +414,14 @@ class weak_ordering
                                    weak_ordering v) noexcept {
     return 0 >= v.value_;
   }
+  friend constexpr bool operator==(weak_ordering v1,
+                                   weak_ordering v2) noexcept {
+    return v1.value_ == v2.value_;
+  }
+  friend constexpr bool operator!=(weak_ordering v1,
+                                   weak_ordering v2) noexcept {
+    return v1.value_ != v2.value_;
+  }
 
  private:
   compare_internal::value_type value_;
@@ -481,6 +513,14 @@ class strong_ordering
                                    strong_ordering v) noexcept {
     return 0 >= v.value_;
   }
+  friend constexpr bool operator==(strong_ordering v1,
+                                   strong_ordering v2) noexcept {
+    return v1.value_ == v2.value_;
+  }
+  friend constexpr bool operator!=(strong_ordering v1,
+                                   strong_ordering v2) noexcept {
+    return v1.value_ != v2.value_;
+  }
 
  private:
   compare_internal::value_type value_;