File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -326,6 +326,16 @@ class LocalVector {
326326 data[i] = p_from.data [i];
327327 }
328328 }
329+ _FORCE_INLINE_ LocalVector (LocalVector &&p_from) {
330+ data = p_from.data ;
331+ count = p_from.count ;
332+ capacity = p_from.capacity ;
333+
334+ p_from.data = nullptr ;
335+ p_from.count = 0 ;
336+ p_from.capacity = 0 ;
337+ }
338+
329339 inline void operator =(const LocalVector &p_from) {
330340 resize (p_from.size ());
331341 for (U i = 0 ; i < p_from.count ; i++) {
@@ -338,6 +348,26 @@ class LocalVector {
338348 data[i] = p_from[i];
339349 }
340350 }
351+ inline void operator =(LocalVector &&p_from) {
352+ if (unlikely (this == &p_from)) {
353+ return ;
354+ }
355+ reset ();
356+
357+ data = p_from.data ;
358+ count = p_from.count ;
359+ capacity = p_from.capacity ;
360+
361+ p_from.data = nullptr ;
362+ p_from.count = 0 ;
363+ p_from.capacity = 0 ;
364+ }
365+ inline void operator =(Vector<T> &&p_from) {
366+ resize (p_from.size ());
367+ for (U i = 0 ; i < count; i++) {
368+ data[i] = std::move (p_from[i]);
369+ }
370+ }
341371
342372 _FORCE_INLINE_ ~LocalVector () {
343373 if (data) {
You can’t perform that action at this time.
0 commit comments