return myPtr;
}
+ //! Move assignment.
+ //! This array will borrow all the data from theOther.
+ NCollection_LocalArray& Move (NCollection_LocalArray& theOther)
+ {
+ if (&theOther == this)
+ {
+ return *this;
+ }
+
+ Deallocate();
+ mySize = theOther.mySize;
+ if (theOther.myPtr == theOther.myBuffer)
+ {
+ // deep copy
+ myPtr = myBuffer;
+ memcpy (myPtr, theOther.myPtr, sizeof(theItem) * theOther.mySize);
+ memset (theOther.myPtr, 0, sizeof(theItem) * theOther.mySize);
+ }
+ else
+ {
+ myPtr = theOther.myPtr;
+ theOther.myPtr = theOther.myBuffer;
+ }
+ return *this;
+ }
+
private:
NCollection_LocalArray (const NCollection_LocalArray& );
return theO;
}
+#ifndef OCCT_NO_RVALUE_REFERENCE
+ //! Move constructor
+ math_IntegerVector (math_IntegerVector&& theOther)
+ {
+ Move (theOther);
+ }
+
+ //! Move assignment operator; @sa Move()
+ math_IntegerVector& operator= (math_IntegerVector&& theOther)
+ {
+ return Move (theOther);
+ }
+#endif
+
+ //! Move assignment.
+ //! This array will borrow all the data from theOther, so that theOther should not be used anymore.
+ math_IntegerVector& Move (math_IntegerVector& theOther)
+ {
+ if (&theOther == this)
+ {
+ return *this;
+ }
+
+ myLocArray.Move (theOther.myLocArray);
+ NCollection_Array1<Standard_Integer> aNewArray (myLocArray[0], theOther.Array.Lower(), theOther.Array.Upper());
+ Array.Move (aNewArray);
+ NCollection_Array1<Standard_Integer> anEmptyArray;
+ theOther.Array.Move (anEmptyArray);
+ return *this;
+ }
+
protected:
//! is used internally to set the Lower value of the IntegerVector.
friend class math_Matrix;
+#ifndef OCCT_NO_RVALUE_REFERENCE
+ //! Move constructor
+ math_Vector (math_Vector&& theOther)
+ {
+ Move (theOther);
+ }
+
+ //! Move assignment operator; @sa Move()
+ math_Vector& operator= (math_Vector&& theOther)
+ {
+ return Move (theOther);
+ }
+#endif
+
+ //! Move assignment.
+ //! This array will borrow all the data from theOther, so that theOther should not be used anymore.
+ math_Vector& Move (math_Vector& theOther)
+ {
+ if (&theOther == this)
+ {
+ return *this;
+ }
+
+ myLocArray.Move (theOther.myLocArray);
+ NCollection_Array1<Standard_Real> aNewArray (myLocArray[0], theOther.Array.Lower(), theOther.Array.Upper());
+ Array.Move (aNewArray);
+ NCollection_Array1<Standard_Real> anEmptyArray;
+ theOther.Array.Move (anEmptyArray);
+ return *this;
+ }
+
protected:
//! Is used internally to set the "theLower" value of the vector.