summaryrefslogtreecommitdiff
path: root/absl/types
diff options
context:
space:
mode:
authorGravatar Jorg Brown <jorg@google.com>2022-11-02 11:44:33 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2022-11-02 11:45:24 -0700
commit1649c037c556bdaca7241bc0113275506bdb9638 (patch)
tree19e752d708620f2ee43e577ff552595252e96216 /absl/types
parenta87df8e9dbe15a2799efdf4f74e89b4fbfda4570 (diff)
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
Diffstat (limited to 'absl/types')
-rw-r--r--absl/types/internal/span.h3
-rw-r--r--absl/types/span.h2
2 files changed, 1 insertions, 4 deletions
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 <typename T>
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 <typename C>
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());
}