summaryrefslogtreecommitdiff
path: root/src/array_view.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/array_view.hh')
-rw-r--r--src/array_view.hh5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/array_view.hh b/src/array_view.hh
index 34bc376e..52c89ac2 100644
--- a/src/array_view.hh
+++ b/src/array_view.hh
@@ -58,8 +58,9 @@ public:
constexpr ArrayView subrange(size_t first, size_t count = -1) const
{
- return ArrayView(m_pointer + std::min(first, m_size),
- std::min(count, m_size - std::min(first, m_size)));
+ auto min = [](size_t a, size_t b) { return a < b ? a : b; };
+ return ArrayView(m_pointer + min(first, m_size),
+ min(count, m_size - min(first, m_size)));
}
private: