Questions tagged «boost-propertytree»

6
使用属性树在Boost中创建JSON数组
我正在尝试使用boost属性树创建一个JSON数组。 该文档说:“ JSON数组被映射到节点。每个元素都是一个具有空名称的子节点。” 因此,我想用空名称创建一个属性树,然后调用write_json(...)将数组取出。但是,文档没有告诉我如何创建未命名的子节点。我尝试过ptree.add_child("", value),但这会产生: Assertion `!p.empty() && "Empty path not allowed for put_child."' failed 该文档似乎没有解决这一点,至少我无法确定。有人可以帮忙吗?

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.