[Development] QVector now has rvalue push_back (was: Re: HEADS UP: potential trouble from a recent QVector change)

Gunnar Roth gunnar.roth at gmx.de
Tue Jul 21 19:49:13 CEST 2015


> 
>      void push_back(T &&t) {
>          ensureCapacity(size() + 1);
>          new (m_end) T(std::move(t));                // move-construct from t
>          ++m_end;
why is std::move needed here? Afaik std::move(t) converts t into a rvalue ref, but t is already an r-value ref.

Regards,
Gunnar Roth




More information about the Development mailing list