From 1649c037c556bdaca7241bc0113275506bdb9638 Mon Sep 17 00:00:00 2001 From: Jorg Brown Date: Wed, 2 Nov 2022 11:44:33 -0700 Subject: Eliminate span_internal::Min in favor of std::min, since Min conflicts with a macro in a third-party library. PiperOrigin-RevId: 485653193 Change-Id: I0615ceb9ea3e1533a989470e7c9863c86b70698b --- absl/types/internal/span.h | 3 --- absl/types/span.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'absl/types') diff --git a/absl/types/internal/span.h b/absl/types/internal/span.h index 1920a89e..d653bb2c 100644 --- a/absl/types/internal/span.h +++ b/absl/types/internal/span.h @@ -32,9 +32,6 @@ template class Span; namespace span_internal { -// A constexpr min function -constexpr size_t Min(size_t a, size_t b) noexcept { return a < b ? a : b; } - // Wrappers for access to container data pointers. template constexpr auto GetDataImpl(C& c, char) noexcept // NOLINT(runtime/references) diff --git a/absl/types/span.h b/absl/types/span.h index cd863a95..d7bdbb1f 100644 --- a/absl/types/span.h +++ b/absl/types/span.h @@ -420,7 +420,7 @@ class Span { // absl::MakeSpan(vec).subspan(5); // throws std::out_of_range constexpr Span subspan(size_type pos = 0, size_type len = npos) const { return (pos <= size()) - ? Span(data() + pos, span_internal::Min(size() - pos, len)) + ? Span(data() + pos, (std::min)(size() - pos, len)) : (base_internal::ThrowStdOutOfRange("pos > size()"), Span()); } -- cgit v1.2.3