[MERGED] osmo-trx[master]: common: Declare explicit Vector move constructor

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Tom Tsou gerrit-no-reply at lists.osmocom.org
Mon Jun 19 17:02:42 UTC 2017


Tom Tsou has submitted this change and it was merged.

Change subject: common: Declare explicit Vector move constructor
......................................................................


common: Declare explicit Vector move constructor

Vector class already has a semantically odd non-const copy
constructor that serves the same function as a C++11 move
constructor. Make the move constructor semantics explicit
and address Coverity at the same time.

Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd
Fixes: Coverity CID 170738
---
M CommonLibs/Vector.h
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Harald Welte: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/CommonLibs/Vector.h b/CommonLibs/Vector.h
index eae674b..15d6710 100644
--- a/CommonLibs/Vector.h
+++ b/CommonLibs/Vector.h
@@ -118,8 +118,8 @@
 	/** Build an empty Vector of a given size. */
 	Vector(size_t wSize=0):mData(NULL) { resize(wSize); }
 
-	/** Build a Vector by shifting the data block. */
-	Vector(Vector<T>& other)
+	/** Build a Vector by moving another. */
+	Vector(Vector<T>&& other)
 		:mData(other.mData),mStart(other.mStart),mEnd(other.mEnd)
 	{ other.mData=NULL; }
 

-- 
To view, visit https://gerrit.osmocom.org/2939
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I22e0099abe601b0c59beee808f7560837c6977dd
Gerrit-PatchSet: 3
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Tom Tsou <tom at tsou.cc>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <tom at tsou.cc>



More information about the gerrit-log mailing list