about summary refs log tree commit diff
path: root/absl/types/span.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/types/span.h')
-rw-r--r--absl/types/span.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/absl/types/span.h b/absl/types/span.h
index 3359ce5093c5..911af0c57a61 100644
--- a/absl/types/span.h
+++ b/absl/types/span.h
@@ -485,6 +485,13 @@ class Span {
                : (base_internal::ThrowStdOutOfRange("pos > size()"), Span());
   }
 
+  // Support for absl::Hash.
+  template <typename H>
+  friend H AbslHashValue(H h, Span v) {
+    return H::combine(H::combine_contiguous(std::move(h), v.data(), v.size()),
+                      v.size());
+  }
+
  private:
   pointer ptr_;
   size_type len_;