mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +01:00
ircd::json: Add boolean constructor for literal rep.
This commit is contained in:
parent
7c9c0ffa38
commit
81bd73f6f0
1 changed files with 9 additions and 0 deletions
|
@ -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}}
|
||||
|
|
Loading…
Reference in a new issue