From a88e58763bd33e021511d2e821703f478afd85bf Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 15 Mar 2017 16:51:55 +0000 Subject: [PATCH] Move SelectionList::set implementation out of the header --- src/selection.cc | 10 ++++++++++ src/selection.hh | 11 +---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/selection.cc b/src/selection.cc index 7424067b..542c44f5 100644 --- a/src/selection.cc +++ b/src/selection.cc @@ -42,6 +42,16 @@ void SelectionList::remove(size_t index) if (index < m_main or m_main == m_selections.size()) --m_main; } +void SelectionList::set(Vector list, size_t main) +{ + kak_assert(main < list.size()); + m_selections = std::move(list); + m_main = main; + sort_and_merge_overlapping(); + update_timestamp(); + check_invariant(); +} + namespace { diff --git a/src/selection.hh b/src/selection.hh index d1fac7fa..08451521 100644 --- a/src/selection.hh +++ b/src/selection.hh @@ -105,6 +105,7 @@ struct SelectionList Selection& operator[](size_t i) { return m_selections[i]; } const Selection& operator[](size_t i) const { return m_selections[i]; } + void set(Vector list, size_t main); SelectionList& operator=(Vector list) { const size_t main_index = list.size()-1; @@ -112,16 +113,6 @@ struct SelectionList return *this; } - void set(Vector list, size_t main) - { - kak_assert(main < list.size()); - m_selections = std::move(list); - m_main = main; - sort_and_merge_overlapping(); - update_timestamp(); - check_invariant(); - } - using iterator = Vector::iterator; iterator begin() { return m_selections.begin(); } iterator end() { return m_selections.end(); }