Fix move constructors with unequal allocators and move/copy assignment of tree.

This commit is contained in:
Ion Gaztañaga
2015-02-26 00:22:23 +01:00
parent d0750f4493
commit c2ea5da716
8 changed files with 25 additions and 17 deletions
@@ -370,7 +370,7 @@ struct node_alloc_holder
protected:
struct cloner
{
cloner(node_alloc_holder &holder)
explicit cloner(node_alloc_holder &holder)
: m_holder(holder)
{}
@@ -380,6 +380,18 @@ struct node_alloc_holder
node_alloc_holder &m_holder;
};
struct move_cloner
{
move_cloner(node_alloc_holder &holder)
: m_holder(holder)
{}
NodePtr operator()(Node &other)
{ return m_holder.create_node(::boost::move(other.get_data())); }
node_alloc_holder &m_holder;
};
struct members_holder
: public NodeAlloc
{