From 09e3095a46d51938fe98065e64f676f49f95b340 Mon Sep 17 00:00:00 2001 From: Bo Rydberg Date: Thu, 3 Jan 2019 20:28:14 +0100 Subject: [PATCH] Support C++98 for etl::sort (#107) Default template arguments are not suported in function templates for C++98. --- include/etl/algorithm.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/include/etl/algorithm.h b/include/etl/algorithm.h index a705f986..65a23687 100644 --- a/include/etl/algorithm.h +++ b/include/etl/algorithm.h @@ -1127,8 +1127,8 @@ namespace etl /// Uses users defined comparison. ///\ingroup algorithm //*************************************************************************** - template ::value_type> > - void sort(TIterator first, TIterator last, TCompare compare = TCompare()) + template + void sort(TIterator first, TIterator last, TCompare compare) { typedef typename std::iterator_traits::difference_type difference_t; @@ -1154,7 +1154,16 @@ namespace etl } } } + + //*************************************************************************** + /// Sorts the elements using shell sort. + ///\ingroup algorithm + //*************************************************************************** + template + void sort(TIterator first, TIterator last) + { + etl::sort(first, last, std::less::value_type>()); + } } #endif -