From 31c4dd1295a48aa59ec0d669e42ed42861ffa3ad Mon Sep 17 00:00:00 2001 From: Marcin Kowalczyk Date: Wed, 31 Jul 2024 15:08:25 +0200 Subject: [PATCH] Add missing `operator!=` definitions for C++ versions earlier than C++20 by deriving from `WithEqual`. PiperOrigin-RevId: 657980040 --- riegeli/chunk_encoding/transpose_encoder.h | 3 ++- riegeli/digests/BUILD | 1 + riegeli/digests/digester_handle.h | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/riegeli/chunk_encoding/transpose_encoder.h b/riegeli/chunk_encoding/transpose_encoder.h index 720a7667..24abfdb5 100644 --- a/riegeli/chunk_encoding/transpose_encoder.h +++ b/riegeli/chunk_encoding/transpose_encoder.h @@ -30,6 +30,7 @@ #include "absl/types/optional.h" #include "absl/types/span.h" #include "riegeli/base/chain.h" +#include "riegeli/base/compare.h" #include "riegeli/base/external_ref.h" #include "riegeli/base/recycling_pool.h" #include "riegeli/bytes/backward_writer.h" @@ -180,7 +181,7 @@ class TransposeEncoder : public ChunkEncoder { // We build a tree structure of protocol buffer tags. `NodeId` uniquely // identifies a node in this tree. - struct NodeId { + struct NodeId : public WithEqual { explicit NodeId(chunk_encoding_internal::MessageId parent_message_id, uint32_t tag); diff --git a/riegeli/digests/BUILD b/riegeli/digests/BUILD index eab69af0..96ff3689 100644 --- a/riegeli/digests/BUILD +++ b/riegeli/digests/BUILD @@ -24,6 +24,7 @@ cc_library( "//riegeli/base:any", "//riegeli/base:arithmetic", "//riegeli/base:chain", + "//riegeli/base:compare", "//riegeli/base:dependency", "//riegeli/base:to_string_view", "//riegeli/base:type_traits", diff --git a/riegeli/digests/digester_handle.h b/riegeli/digests/digester_handle.h index ac816a2a..f80fa8fe 100644 --- a/riegeli/digests/digester_handle.h +++ b/riegeli/digests/digester_handle.h @@ -32,6 +32,7 @@ #include "absl/types/optional.h" #include "riegeli/base/any.h" #include "riegeli/base/chain.h" +#include "riegeli/base/compare.h" #include "riegeli/base/dependency.h" #include "riegeli/base/dependency_manager.h" #include "riegeli/base/to_string_view.h" @@ -126,7 +127,7 @@ class #ifdef ABSL_NULLABILITY_COMPATIBLE ABSL_NULLABILITY_COMPATIBLE #endif - DigesterBaseHandle { + DigesterBaseHandle : WithEqual { public: // Creates a `DigesterBaseHandle` which does not point to a target. DigesterBaseHandle() = default;