Boost logo

Boost Users :

Subject: Re: [Boost-users] [property_tree] number of sections in an inifile
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2012-03-22 11:30:25


On 22.03.2012, at 15:48, Sean Farrow wrote:

> Hi:
> If I have defined:
> boost::property_tree::ptree IniTree;
> What is the correct way to determine how many sections there are in an ini file. Should I use count, max_size, m_children or size?

m_children is private. count() takes an argument. max_size(), according to the Container concept, returns how many elements (children, in the case of ptree) there could possibly be. size() returns how many there are.

size() is the right answer.

Sebastian



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net