Ticket #7031: (back_|front_)move_insert_iterator::op= cannot take rvalue

[SVN r79431]
This commit is contained in:
Ion Gaztañaga
2012-07-11 22:32:47 +00:00
parent 011e729ca6
commit 34009be499

View File

@@ -813,12 +813,17 @@ class back_move_insert_iterator
public:
typedef C container_type;
typedef typename C::value_type value_type;
typedef typename C::reference reference;
explicit back_move_insert_iterator(C& x) : container_m(&x) { }
back_move_insert_iterator& operator=(typename C::reference x)
back_move_insert_iterator& operator=(reference x)
{ container_m->push_back(boost::move(x)); return *this; }
back_move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
{ reference rx = x; return this->operator=(rx); }
back_move_insert_iterator& operator*() { return *this; }
back_move_insert_iterator& operator++() { return *this; }
back_move_insert_iterator& operator++(int) { return *this; }
@@ -848,12 +853,17 @@ class front_move_insert_iterator
public:
typedef C container_type;
typedef typename C::value_type value_type;
typedef typename C::reference reference;
explicit front_move_insert_iterator(C& x) : container_m(&x) { }
front_move_insert_iterator& operator=(typename C::reference x)
front_move_insert_iterator& operator=(reference x)
{ container_m->push_front(boost::move(x)); return *this; }
front_move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
{ reference rx = x; return this->operator=(rx); }
front_move_insert_iterator& operator*() { return *this; }
front_move_insert_iterator& operator++() { return *this; }
front_move_insert_iterator& operator++(int) { return *this; }
@@ -881,18 +891,23 @@ class move_insert_iterator
public:
typedef C container_type;
typedef typename C::value_type value_type;
typedef typename C::reference reference;
explicit move_insert_iterator(C& x, typename C::iterator pos)
: container_m(&x), pos_(pos)
{}
move_insert_iterator& operator=(typename C::reference x)
move_insert_iterator& operator=(reference x)
{
pos_ = container_m->insert(pos_, ::boost::move(x));
++pos_;
return *this;
}
move_insert_iterator& operator=(BOOST_RV_REF(value_type) x)
{ reference rx = x; return this->operator=(rx); }
move_insert_iterator& operator*() { return *this; }
move_insert_iterator& operator++() { return *this; }
move_insert_iterator& operator++(int) { return *this; }