diff options
author | Andrzej Rybczak <electricityispower@gmail.com> | 2009-10-17 17:01:48 +0200 |
---|---|---|
committer | Andrzej Rybczak <electricityispower@gmail.com> | 2009-10-17 17:01:48 +0200 |
commit | a98eb5e9ac71b82c9670d89a6b3769b602bb51c7 (patch) | |
tree | 021cd11bc8eeea56cc8259ccebce3d828c7037ca /src/menu.h | |
parent | 601c8e3ef2f2e1dd856b61b520cbb7bb4d3c6fbb (diff) |
add range support in NCurses::Menu::Sort()
Diffstat (limited to 'src/menu.h')
-rw-r--r-- | src/menu.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -394,11 +394,11 @@ namespace NCurses /// Sorts all items using Comparison object with defined operator() /// @param beginning beginning of range that has to be sorted /// - template <typename Comparison> void Sort(size_t beginning = 0) + template <typename Comparison> void Sort(size_t beginning = 0, size_t end = -1) { if (itsOptions.empty()) return; - sort(itsOptions.begin()+beginning, itsOptions.end(), InternalSorting<Comparison>()); + sort(itsOptions.begin()+beginning, end == size_t(-1) ? itsOptions.end() : itsOptions.begin()+end, InternalSorting<Comparison>()); if (isFiltered()) ApplyFilter(itsFilter); } |