Fix array_view dependency on std::min

This commit is contained in:
Maxime Coste 2019-01-24 22:54:56 +11:00
parent 346c78f5e0
commit c7f4d4dd27

View File

@ -58,8 +58,9 @@ public:
constexpr ArrayView subrange(size_t first, size_t count = -1) const constexpr ArrayView subrange(size_t first, size_t count = -1) const
{ {
return ArrayView(m_pointer + std::min(first, m_size), auto min = [](size_t a, size_t b) { return a < b ? a : b; };
std::min(count, m_size - std::min(first, m_size))); return ArrayView(m_pointer + min(first, m_size),
min(count, m_size - min(first, m_size)));
} }
private: private: