summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}