From 3936861b7c40912123c687ed5999639cb6f00787 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Sun, 27 Dec 2009 14:13:39 +0000 Subject: allowed list to be sorted with default comparator svn-id: r46644 --- common/algorithm.h | 6 ++++-- common/list_intern.h | 1 + test/common/algorithm.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/algorithm.h b/common/algorithm.h index d730a3ada2..4a2acef7a5 100644 --- a/common/algorithm.h +++ b/common/algorithm.h @@ -216,8 +216,10 @@ void sort(T *first, T *last) { sort(first, last, Common::Less()); } -///\todo add value_type to all iterators and add default sort variant with Common::Less() - +template +void sort(T first, T last) { + sort(first, last, Common::Less()); +} } // End of namespace Common #endif diff --git a/common/list_intern.h b/common/list_intern.h index 11d03fd6ff..b7fbaffc47 100644 --- a/common/list_intern.h +++ b/common/list_intern.h @@ -53,6 +53,7 @@ namespace ListInternal { typedef Node * NodePtr; typedef T & ValueRef; typedef T * ValuePtr; + typedef T ValueType; NodeBase *_node; diff --git a/test/common/algorithm.h b/test/common/algorithm.h index bb2932178d..ed87d6850d 100644 --- a/test/common/algorithm.h +++ b/test/common/algorithm.h @@ -76,7 +76,7 @@ public: TS_ASSERT_EQUALS(checkSort(list.begin(), list.end(), Common::Less()), true); // already sorted - Common::sort(list.begin(), list.end(), Common::Less()); + Common::sort(list.begin(), list.end()); TS_ASSERT_EQUALS(checkSort(list.begin(), list.end(), Common::Less()), true); } }; -- cgit v1.2.3