【发布时间】:2011-11-11 15:56:54
【问题描述】:
我需要向 boost::property_tree::ptree 添加未命名的节点,就像它的 JSON 解析器对数组所做的那样。但是,当我想这样做时,我会在运行时得到这样的断言:
Assertion failed: !p.empty() && "Empty path not allowed for put_child.", file C:\Program Files\Boost\boost\include/boost/property_tree/detail/ptree_implementation.hpp, line 877
我喜欢
tree.add_child(name, child);
其中 tree 和 child 都是 ptree-s 和 name char*。
我怎么能像 ptree-s 的 JSON 解析器那样做呢?
【问题讨论】:
标签: c++ boost boost-propertytree