From ad13a4b2aceb22979bfd513508b2699ab65e9671 Mon Sep 17 00:00:00 2001 From: Lee Clagett Date: Thu, 19 Mar 2020 19:49:51 -0400 Subject: Fixing static_asserts in ZMQ JSON --- src/serialization/json_object.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/serialization') diff --git a/src/serialization/json_object.cpp b/src/serialization/json_object.cpp index e98ba0483..51cd3daf5 100644 --- a/src/serialization/json_object.cpp +++ b/src/serialization/json_object.cpp @@ -190,7 +190,7 @@ void fromJsonValue(const rapidjson::Value& val, int& i) void toJsonValue(rapidjson::Writer& dest, const unsigned long long i) { - static_assert(std::numeric_limits::max() <= std::numeric_limits::max(), "bad uint64 conversion"); + static_assert(!precision_loss(), "bad uint64 conversion"); dest.Uint64(i); } @@ -201,8 +201,7 @@ void fromJsonValue(const rapidjson::Value& val, unsigned long long& i) void toJsonValue(rapidjson::Writer& dest, const long long i) { - static_assert(std::numeric_limits::min() <= std::numeric_limits::min(), "bad int64 conversion"); - static_assert(std::numeric_limits::max() <= std::numeric_limits::max(), "bad int64 conversion"); + static_assert(!precision_loss(), "bad int64 conversion"); dest.Int64(i); } -- cgit v1.2.3