boost property tree, iterators to an element for inserting?

喜欢而已 提交于 2019-12-01 13:06:59

You can get an iterator to an element using the begin() method:

  base.get_child("BRANCH").begin();

In order to insert every element in t on that position, you should use:

base.insert(base.get_child("BRANCH").begin(), t.begin(), t.end());

If t contains one parent node or you only want to insert the first node, you can use:

base.insert(base.get_child("BRANCH").begin(), t.front());
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!