summaryrefslogtreecommitdiffstats
path: root/staging_vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-01-14 13:26:53 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-01-14 13:50:19 +0000
commit43c2145f1bfab0f2d5d5b3b3999bc7c99c2d62dd (patch)
tree3f01160dff20b50d37edd12a6306261eb1a9cbb2 /staging_vespalib
parent3d0321eca4f93717e4afda679ca735b0b3535ce2 (diff)
Handle bool in grouping in the backend too.
Diffstat (limited to 'staging_vespalib')
-rw-r--r--staging_vespalib/src/vespa/vespalib/util/sort.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/staging_vespalib/src/vespa/vespalib/util/sort.h b/staging_vespalib/src/vespa/vespalib/util/sort.h
index d5c73df9b96..c4bf0d6326b 100644
--- a/staging_vespalib/src/vespa/vespalib/util/sort.h
+++ b/staging_vespalib/src/vespa/vespalib/util/sort.h
@@ -169,6 +169,27 @@ public:
};
template<>
+class convertForSort<bool, true>
+{
+public:
+ typedef bool InputType;
+ typedef bool IntType;
+ typedef bool UIntType;
+ typedef std::less<InputType> Compare;
+ static inline UIntType convert(IntType value) { return value; }
+};
+template<>
+class convertForSort<bool, false>
+{
+public:
+ typedef bool InputType;
+ typedef bool IntType;
+ typedef bool UIntType;
+ typedef std::less<InputType> Compare;
+ static inline UIntType convert(IntType value) { return !value; }
+};
+
+template<>
class convertForSort<int8_t, true>
{
public: