Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-04-19 10:33:50


I dont understand the char_type member typedef of the traits class. The
functions that use it all seeem to be free functions which could change from
e.g

template<class Ptree>
void read_xml(std::basic_istream<typename Ptree::char_type> &stream,
              Ptree &pt,
              int flags = 0);

to

template<class Ptree, class Char>
void read_xml(std::basic_istream<Char> &stream, Ptree &pt,int flags = 0);

without problems. That would remove one level of coupling wouldnt it?

...........

Why are all ptree nodes the same type? Commonly a tree will have branch and leaf
nodes. In the debug example there are two branch nodes and 4 leaf nodes, which
means two empty lists . That is wasteful isnt it?

................

Is it necessary to make key a string. Could it not also be (say) an integer id?

regards
Andy Little


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