From 501fbc08ae5493db77bb34f4c4fbe1f3a3bc14e3 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 15 Mar 2019 17:24:46 -0700 Subject: Change compare_by_commodity to return an integer --- src/balance.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/balance.cc') diff --git a/src/balance.cc b/src/balance.cc index 1ae9edb2..5f5e6fc9 100644 --- a/src/balance.cc +++ b/src/balance.cc @@ -244,8 +244,11 @@ void balance_t::sorted_amounts(amounts_array& sorted) const { foreach (const amounts_map::value_type& pair, amounts) sorted.push_back(&pair.second); - std::stable_sort(sorted.begin(), sorted.end(), - commodity_t::compare_by_commodity()); + std::stable_sort( + sorted.begin(), sorted.end(), + [](const amount_t * left, const amount_t * right) { + return commodity_t::compare_by_commodity()(left, right) < 0; + }); } void balance_t::map_sorted_amounts(function fn) const -- cgit v1.2.3