Boost logo

Boost :

From: Marcin Kalicinski (kalita_at_[hidden])
Date: 2006-04-11 09:55:19


> 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.

Data doesn't have to be a basic_string. You can change it to anything else
by supplying different traits to basic_ptree class template. There is an
example showing how to use tree with boost::any instead of the string.

On the other hand, please note that this library is not a generic tree
container - it is intended to be used as a DOM that supports reading/writing
multiple data formats out of the box, and gives easy and idiomatic access to
the data, without writing miles of supporting code.

> What is the rationale for using the word "property" here?

The class is a map from keys to properties (data). I think that idea for the
name originally came from java.util.Properties class in Java, which has
similar purpose but is flat, not tree-like.

Best regards,
Marcin


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