On Tuesday 21 July 2015 12:40:26 Marc Mutz wrote:
So start using qMove() or pass temporaries in your QVector::append()
calls.
Are we also using move internally when resizing and detaching?
No.
For detach, we cannot (we need a copy).
For resize, the pressure to implement it
On Tuesday 21 July 2015 08:55:42 Thiago Macieira wrote:
In my version of QVector, this is already implemented. Movable and trivial
types are simply realloc()ed, so no copy takes place.
Oops, no, sorry, this only works for types that also don't require special
alignment (less than
On Tuesday 21 July 2015 09:09:36 Julien Blanc wrote:
The templateness changes how a type different than the vector's type gets
constructed (it might undergo a conversion first).
Not sure i understand you well there. The variadic and templateness
changes it so that no temporary gets
On Tuesday 21 July 2015 17:53:55 Thiago Macieira wrote:
I'm asking why one of the two would be better than the other if I'm trying
to add a single T to std::vectorT. You've explained that emplace_back
is efficient, but you haven't said whether push_back is as efficient, more
efficient or less
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
On Tue, Jul 21, 2015 at 12:49 PM Gunnar Roth gunnar.r...@gmx.de wrote:
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)
On Tuesday 21 July 2015 19:49:13 Gunnar Roth wrote:
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)
Gunnar Roth gunnar.r...@gmx.de
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
Am 21.07.2015 um 19:58 schrieb Milian Wolff milian.wo...@kdab.com:
On Tuesday 21 July 2015 19:49:13 Gunnar Roth wrote:
void push_back(T t) {
ensureCapacity(size() + 1);
new (m_end) T(std::move(t));// move-construct
from t
++m_end;
Am 21.07.2015 um 20:11 schrieb Bubke Marco marco.bu...@theqtcompany.com:
Gunnar Roth gunnar.r...@gmx.de
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
On Tuesday 21 July 2015 20:11:33 Bubke Marco wrote:
Gunnar Roth gunnar.r...@gmx.de
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
Le lundi 20 juillet 2015 à 12:26 -0700, Thiago Macieira a écrit :
On Monday 20 July 2015 18:25:43 Keith Gardner wrote:
What's the difference in std::vector between an rvalue push_back and
emplace_back?
emplace_back takes variadic template arguments to construct the item
directly in
2015-07-20 21:26 GMT+02:00 Thiago Macieira thiago.macie...@intel.com:
Aside from the variadic and the templateness, what's the difference?
The templateness changes how a type different than the vector's type gets
constructed (it might undergo a conversion first). But assuming I am
pushing
On Tuesday 21 July 2015 11:23:26 Allan Sandfeld Jensen wrote:
On Monday 20 July 2015, Marc Mutz wrote:
https://codereview.qt-project.org/121810
So start using qMove() or pass temporaries in your QVector::append()
calls.
Are we also using move internally when resizing and detaching?
https://codereview.qt-project.org/121810
So start using qMove() or pass temporaries in your QVector::append() calls.
--
Marc Mutz marc.m...@kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbH Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt Experts
On Mon, Jul 20, 2015 at 1:11 PM Thiago Macieira thiago.macie...@intel.com
wrote:
On Monday 20 July 2015 14:06:33 Marc Mutz wrote:
https://codereview.qt-project.org/121810
So start using qMove() or pass temporaries in your QVector::append()
calls.
What's the difference in std::vector
On Monday 20 July 2015 14:06:33 Marc Mutz wrote:
https://codereview.qt-project.org/121810
So start using qMove() or pass temporaries in your QVector::append() calls.
What's the difference in std::vector between an rvalue push_back and
emplace_back?
--
Thiago Macieira - thiago.macieira (AT)
On Monday 20 July 2015 18:25:43 Keith Gardner wrote:
What's the difference in std::vector between an rvalue push_back and
emplace_back?
emplace_back takes variadic template arguments to construct the item
directly in the vector instead of creating a temporary and then performing
a move
18 matches
Mail list logo