Under MSVC2010 the definition of move constructor for vector class is the following :
vector(_Myt&& _Right)
: _Mybase(_Right._Alval)
{ // construct by moving _Right
_Assign_rv(_STD forward<_Myt>(_Right));
}
As there is also a definition of a copy constructor, I guess we never call vector(_Myt&& _Right) with a lvalue reference as argument.
So I’m wondering if here, this line :
_Assign_rv(_STD forward<_Myt>(_Right));
could be replace by :
_Assign_rv(_STD move<_Myt>(_Right));
with no side effect
Yes, for a type without reference qualifiers
T, bothstd::forward<T>andstd::forward<T&&>are just fancy ways of sayingstd::move.