gpt4 book ai didi

c++ - 缺少 boost::property_tree::ordered_end()

转载 作者:太空狗 更新时间:2023-10-29 21:41:25 26 4
gpt4 key购买 nike

我正在尝试遍历 boost 属性树。 docs声明

You can get an ordered view of all children by using ordered_begin() and ordered_end().

但是,当我写

for ( boost::property_tree::ptree::const_assoc_iterator it =
myPropTree.ordered_begin();
it != myPropTree.ordered_end();
it++ )

编译器报错

error: 'boost::property_tree::ptree' has no member named 'ordered_end'
boost v1.55mingwcode::blocks

最佳答案

The ptree documentation says :

assoc_iterator ordered_begin();

Returns an iterator to the first child, in key order.

const_assoc_iterator ordered_begin() const;

Returns an iterator to the first child, in key order.

assoc_iterator not_found();

Returns the not-found iterator. Equivalent to end() in a real associative container.

const_assoc_iterator not_found() const;

Returns the not-found iterator. Equivalent to end() in a real associative container.

所以基本上 ordered_end 函数被称为 not_found

关于c++ - 缺少 boost::property_tree::ordered_end(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28861619/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com