gpt4 book ai didi

c++ - 使用空元素 boost Json

转载 作者:行者123 更新时间:2023-11-28 00:34:55 24 4
gpt4 key购买 nike

我正在尝试将 boost ptree 与 boost json 解析器一起使用。生成 json 消息时,我可以将一个值设置为 true 或 false 并编译程序。

哪个关键字用于null?我找不到它。

最佳答案

没有。不支持输出空值。输出 bool 值也不是。所有值都输出为字符串、句点。

来自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('"');

}

关于c++ - 使用空元素 boost Json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21343292/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com