From 87e4267872c90c097abdc6cb78fb8a88fae3eda8 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Wed, 26 Mar 2014 18:56:13 +0100 Subject: [PATCH] Slightly improved version of compareImpl in containerbase.h --- src/blackmisc/containerbase.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/blackmisc/containerbase.h b/src/blackmisc/containerbase.h index ec567fd44..ae92fefcb 100644 --- a/src/blackmisc/containerbase.h +++ b/src/blackmisc/containerbase.h @@ -13,6 +13,7 @@ #include "valueobject.h" #include "valuemap.h" #include "predicates.h" +#include "json.h" #include #define _SCL_SECURE_NO_WARNINGS // suppress MSVC unchecked iterator warning for std::transform @@ -207,11 +208,9 @@ namespace BlackMisc //! \copydoc BlackMisc::CValueObject::compareImpl virtual int compareImpl(const CValueObject &other) const override { - Q_UNUSED(other); - - //const auto &o = static_cast(other); - //if (derived().size() < o.derived().size()) { return -1; } - //if (derived().size() > o.derived().size()) { return 1; } + const auto &o = static_cast(other); + if (derived().size() < o.derived().size()) { return -1; } + if (derived().size() > o.derived().size()) { return 1; } //for (auto i1 = derived().cbegin(), i2 = o.derived().cbegin(); i1 != derived().cend() && i2 != o.derived().cend(); ++i1, ++i2) //{ // if (*i1 < *i2) { return -1; }