我需要将未命名的节点添加到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
Run Code Online (Sandbox Code Playgroud)
我这样做
tree.add_child(name, child);
Run Code Online (Sandbox Code Playgroud)
树和子都是ptree-s和名字char*.
我怎么能像ptree-s的JSON解析器那样做呢?