I use boost::property_tree::ptree
quite a bit, but I've found that I create, pass around, and then save copies too many times. With big ptree
objects this is expensive.
Boost provides a swap function, but no move constructor. Why would they do that?
My current solution is to extend ptree and make one myself:
class MyPtree : public boost::property_tree::ptree
{
MyPtree(MyPtree&& other)
{
swap(other);
}
... plus adding the other constructors and operators
};
Is this the best solution or am I missing something?