Merged from trunk

[SVN r79560]
This commit is contained in:
Ion Gaztañaga
2012-07-16 09:05:33 +00:00
parent fd7aaebd3f
commit 8cd85f9cd3

View File

@@ -217,7 +217,7 @@
#if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED) #if defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_MOVE_DOXYGEN_INVOKED)
//Move emulation rv breaks standard aliasing rules so add workarounds for some compilers //Move emulation rv breaks standard aliasing rules so add workarounds for some compilers
#ifdef __GNUC__ #if defined(__GNUC__) && (__GNUC__ >= 4)
#define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__)) #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS __attribute__((__may_alias__))
#else #else
#define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS #define BOOST_MOVE_ATTRIBUTE_MAY_ALIAS
@@ -812,13 +812,18 @@ class back_move_insert_iterator
C* container_m; C* container_m;
public: public:
typedef C container_type; 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) { } 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; } { 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++() { return *this; } back_move_insert_iterator& operator++() { return *this; }
back_move_insert_iterator& operator++(int) { return *this; } back_move_insert_iterator& operator++(int) { return *this; }
@@ -847,13 +852,18 @@ class front_move_insert_iterator
C* container_m; C* container_m;
public: public:
typedef C container_type; 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) { } 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; } { 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++() { return *this; } front_move_insert_iterator& operator++() { return *this; }
front_move_insert_iterator& operator++(int) { return *this; } front_move_insert_iterator& operator++(int) { return *this; }
@@ -880,19 +890,24 @@ class move_insert_iterator
typename C::iterator pos_; typename C::iterator pos_;
public: public:
typedef C container_type; 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) explicit move_insert_iterator(C& x, typename C::iterator pos)
: container_m(&x), pos_(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_ = container_m->insert(pos_, ::boost::move(x));
++pos_; ++pos_;
return *this; 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++() { return *this; } move_insert_iterator& operator++() { return *this; }
move_insert_iterator& operator++(int) { return *this; } move_insert_iterator& operator++(int) { return *this; }