Getting boost property_tree parent node

前端 未结 1 1449
挽巷
挽巷 2021-01-22 21:35

I am using boost property_tree in my program. I\'ve set up the tree for using custom path type. What I\'m looking for is getting a specific node\'s parent node id.

Here

相关标签:
1条回答
  • 2021-01-22 22:22

    You can't.

    Boost Ptree nodes are self-contained and do not know about any containing datastructure (it's the the "tree" equivalent of a singly-linked list).

    As a best approximation you could look up the child inside the parent, e.g. with something like in C++: boost ptree relative key.

    This presumes you always have "a root" available to search in.

    0 讨论(0)
提交回复
热议问题