From 81bd73f6f0eb86d0bd83883a69f9c5ead1a3d779 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 28 Aug 2017 17:11:48 -0700 Subject: [PATCH] ircd::json: Add boolean constructor for literal rep. --- include/ircd/json/value.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/ircd/json/value.h b/include/ircd/json/value.h index a877c1763..c2be757ed 100644 --- a/include/ircd/json/value.h +++ b/include/ircd/json/value.h @@ -82,6 +82,7 @@ namespace ircd::json template<> value::value(const float &floating); template<> value::value(const int32_t &integer); template<> value::value(const int16_t &integer); + template<> value::value(const bool &boolean); template<> value::value(const std::string &str); } @@ -165,6 +166,14 @@ ircd::json::value::value(const int16_t &integer) :value{int64_t(integer)} {} +template<> inline +ircd::json::value::value(const bool &boolean) +:value +{ + boolean? "true" : "false", + type::LITERAL +}{} + template<> inline ircd::json::value::value(const std::string &str) :value{string_view{str}}