0

Modernize equality operators in //services

This CL is pure clean-up and contains no functionality changes.
Depending on the files covered in the CL (since the CL was generated
using git cl split), it does a subset of the following:
the following:
- Remove unneeded operator!= declarations/definitions since C++20 can
  automatically derive those from operator==.
- Default operator== where this is equivalent to the current behavior.
- Default operator<=> where this is equivalent to the current
  behavior.

This CL was uploaded by git cl split.

R=asvitkine@chromium.org

Bug: 40256175
Change-Id: I3cdc3433c03a182a46a4b00c867560bf3cf7cde9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6540428
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Auto-Submit: Jan Keitel <jkeitel@google.com>
Commit-Queue: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1459427}
This commit is contained in:
Jan Keitel
2025-05-13 07:44:38 -07:00
committed by Chromium LUCI CQ
parent 01b07d3b94
commit 5949665eb1

@ -116,12 +116,8 @@ class METRICS_EXPORT SourceIdObj {
constexpr SourceIdObj& operator=(const SourceIdObj& other) = default;
// Allow identity comparisons.
constexpr bool operator==(SourceIdObj other) const {
return value_ == other.value_;
}
constexpr bool operator!=(SourceIdObj other) const {
return value_ != other.value_;
}
friend constexpr bool operator==(const SourceIdObj&,
const SourceIdObj&) = default;
// Extract the Type of the SourceId.
Type GetType() const;