【发布时间】:2014-01-24 22:01:13
【问题描述】:
我正在尝试将 boost ptree 与 boost json 解析器一起使用。生成 json 消息时,我可以将值设置为 true 或 false 并编译程序。
哪个关键字用于null?我找不到它。
【问题讨论】:
我正在尝试将 boost ptree 与 boost json 解析器一起使用。生成 json 消息时,我可以将值设置为 true 或 false 并编译程序。
哪个关键字用于null?我找不到它。
【问题讨论】:
没有。不支持输出空值。输出布尔值也不是。所有值都以字符串、句点的形式输出。
来自json_parser_write.hpp:
// Value or object or array
if (indent > 0 && pt.empty())
{
// Write value
Str data = create_escapes(pt.template get_value<Str>());
stream << Ch('"') << data << Ch('"');
}
【讨论】: