From 1ac4d673b61a95854403189bf2e2f9eaad1e32be Mon Sep 17 00:00:00 2001 From: Niels Date: Sun, 3 May 2015 18:46:26 +0200 Subject: [PATCH] fixed test case --- src/json.hpp | 7 +++++++ src/json.hpp.re2c | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/json.hpp b/src/json.hpp index 0b5e24f0..00ee8c2c 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -239,6 +239,13 @@ class basic_json 2 // float } }; + + // discarded values are not comparable + if (lhs == value_t::discarded or rhs == value_t::discarded) + { + return false; + } + return order[static_cast(lhs)] < order[static_cast(rhs)]; } diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c index 96f6e4c1..9146c44f 100644 --- a/src/json.hpp.re2c +++ b/src/json.hpp.re2c @@ -239,6 +239,13 @@ class basic_json 2 // float } }; + + // discarded values are not comparable + if (lhs == value_t::discarded or rhs == value_t::discarded) + { + return false; + } + return order[static_cast(lhs)] < order[static_cast(rhs)]; }