From 455e917070db14df06bcb81d7970284311801fc5 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 9 Sep 2019 10:24:28 +1000 Subject: [PATCH] list/sort: remove the forwarding comparison operator --- list/sort.hpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/list/sort.hpp b/list/sort.hpp index 034f65f8..e2778265 100644 --- a/list/sort.hpp +++ b/list/sort.hpp @@ -14,15 +14,11 @@ #include namespace cruft::list { + /// A simple tuple-style linked list node. template struct node { node *next; ValueT data; - - bool operator< (node const &rhs) const - { - return data < rhs.data; - } }; @@ -61,7 +57,7 @@ namespace cruft::list { return first; auto extract = [&] () { - auto &target = *first < *middle ? first : middle; + auto &target = first->data < middle->data ? first : middle; auto res = target; target = target->next; return res; @@ -113,7 +109,7 @@ namespace cruft::list { auto b = head->next; while (b) { - if (*b < *a) + if (b->data < a->data) return false; a = a->next;