Registered Member
|
AFAIK STL vector will move objects instead of copying when re-allocating internal storage as long as stored class provides move constructor/assignment.
This can be very efficient both in terms of memory and speed when working with large matrices:
In the above example no copy of matrix should be created? Right? |
Moderator
|
hm, better use emplace_back instead of push_back(move), emplace_back should fail to compile if the type is not MoveInsertable
|
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]