Boost logo

Boost :

From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2006-04-11 09:29:09


On 4/11/06, David Abrahams <dave_at_[hidden]> wrote:

> What is the rationale for using the word "property" here?
>
> Why is this data structure not a more generic tree? It seems as
> though forcing the data on a tree node to be a specialization of
> basic_string is needlessly limiting.

Perhaps the use of std::string is needlessly limiting, but what makes the
property_tree a little bit different than a generic tree container is the
concept that child nodes are associated with a key, and there are
convenience methods provided for finding nodes by their "path" in the tree.

The same effect could perhaps be accomlished using (hypothetically) a
generic_tree<std::pair<std::string, std::string> >, but this would need to
in turn be wrapped in another interface to achieve the same ease-of-use.

--
Caleb Epstein
caleb dot epstein at gmail dot com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk