Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

boost::property_tree::ordered_end() missing

I am trying to iterate over a boost property tree. The docs state that

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

However, when I write

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

The compiler complains

error: 'boost::property_tree::ptree' has no member named 'ordered_end'
boost v1.55
mingw
code::blocks
like image 344
ravenspoint Avatar asked Sep 07 '25 22:09

ravenspoint


1 Answers

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.

So basically theordered_end function is called not_found

like image 179
Drax Avatar answered Sep 10 '25 01:09

Drax