From 3ef8a6160ddb8e5012d49a194771e8bc24d38121 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 18 Feb 2020 19:28:10 +1100 Subject: [PATCH] Small code style tweak in ranges.hh --- src/ranges.hh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ranges.hh b/src/ranges.hh index 02757283..2f288d0f 100644 --- a/src/ranges.hh +++ b/src/ranges.hh @@ -184,8 +184,8 @@ struct TransformView Iterator& operator+=(difference_type diff) { m_it += diff; return *this; } Iterator& operator-=(difference_type diff) { m_it -= diff; return *this; } - Iterator operator+(difference_type diff) { return {*m_transform, m_it + diff}; } - Iterator operator-(difference_type diff) { return {*m_transform, m_it - diff}; } + Iterator operator+(difference_type diff) const { return {*m_transform, m_it + diff}; } + Iterator operator-(difference_type diff) const { return {*m_transform, m_it - diff}; } friend bool operator==(const Iterator& lhs, const Iterator& rhs) { return lhs.m_it == rhs.m_it; } friend bool operator!=(const Iterator& lhs, const Iterator& rhs) { return not (lhs == rhs); } @@ -480,8 +480,8 @@ auto gather() }); } -template -auto elements(bool exact_size = false) +template +auto elements() { return make_view_factory([=] (auto&& range) { using std::begin; using std::end; @@ -500,16 +500,16 @@ auto elements(bool exact_size = false) }); } -template -auto static_gather_impl(std::index_sequence, bool exact_size) +template +auto static_gather_impl(std::index_sequence) { - return elements(exact_size); + return elements(); } -template +template auto static_gather() { - return static_gather_impl(std::make_index_sequence(), exact_size); + return static_gather_impl(std::make_index_sequence()); } }