8 Oct 01:42
[property_tree] Conversion constructor missing?
From: Boris <boriss <at> web.de>
Subject: [property_tree] Conversion constructor missing?
Newsgroups: gmane.comp.lib.boost.devel
Date: 2008-10-07 23:44:49 GMT
Subject: [property_tree] Conversion constructor missing?
Newsgroups: gmane.comp.lib.boost.devel
Date: 2008-10-07 23:44:49 GMT
Imagine you have this XML structure (copied from the documentation and
shortened):
<debug>
<modules>
<module>Finance</module>
<module>Admin</module>
<module>HR</module>
</modules>
</debug>
Now imagine you have this function which you want to call three times to
pass the <module>...</module> nodes to:
void foo(boost::property_tree::ptree pt);
You can use get_child("debug.modules") to retrieve a property tree
containing all module nodes. However if you iterate over the property tree
the iterator refers to std::pair<const key_type, basic_ptree<Tr>> - and
there is no simple way to convert this pair to a new property tree. You
must create an empty property tree followed by a call to push_back() to
insert the pair. Either there is a conversion constructor missing or I
miss something and there is a simpler way of what I'm trying to do?
Boris
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
(Continue reading)
RSS Feed