summaryrefslogtreecommitdiff
path: root/src/menu.h
diff options
context:
space:
mode:
authorAndrzej Rybczak <electricityispower@gmail.com>2009-10-17 17:01:48 +0200
committerAndrzej Rybczak <electricityispower@gmail.com>2009-10-17 17:01:48 +0200
commita98eb5e9ac71b82c9670d89a6b3769b602bb51c7 (patch)
tree021cd11bc8eeea56cc8259ccebce3d828c7037ca /src/menu.h
parent601c8e3ef2f2e1dd856b61b520cbb7bb4d3c6fbb (diff)
add range support in NCurses::Menu::Sort()
Diffstat (limited to 'src/menu.h')
-rw-r--r--src/menu.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/menu.h b/src/menu.h
index dba0afa5..41bf56d7 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -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);
}