Commit 1649c037 by Jorg Brown Committed by Copybara-Service

Eliminate span_internal::Min in favor of std::min, since Min conflicts with a…

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
parent a87df8e9
......@@ -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)
......
......@@ -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());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment