I will have to say it's unreproducible.
I used my Visual studio 2015 Update 3 and the output is normal :
66 79 154 24 76 13 7
Moreover, under VC++ implementation there is no problem moving the vector to itself:
_Myt& operator=(_Myt&& _Right)
{ // assign by moving _Right
if (this != &_Right)
{ // different, assign it
clear();
if (_Alty::propagate_on_container_move_assignment::value
&& this->get_allocator() != _Right.get_allocator())
{ // assign vector, dumping proxy
this->_Free_proxy();
this->_Myvec = _STD move(_Right._Myvec);
this->_Alloc_proxy();
}
else
this->_Myvec = _STD move(_Right._Myvec);
this->_Mysize = _Right._Mysize;
_Right._Mysize = 0;
}
return (*this);
}
as you can see from the condition this != &_Right
, the moving will only happen if you are not moving a vector to itself.
EDIT:
apparently the compiler which is used to compile "C++14" on Ideone (GCC?) decides to not check self-move assignment and decides to free the vector data.
as we can see from this little experiment, after the move the vector size is 0. as said in other previous answers/comments, assigning a move to itself is implementation defined. I guess VC++ does the right thing in this case.
EDIT 2:
it appears that GCC really doesn't check for self asignment. it moves the vector data into a temporary one, and takes __x
data, which in that point is already empty. man, sometimes GCC behaves stupidly just for sake of false sense performance ( because cmp + jz are really going to slow your program down? please.)