btVector3 Copy Constructor
-
- Posts: 2
- Joined: Wed Sep 29, 2010 11:55 am
btVector3 Copy Constructor
Is there any particular reason why btVector3 relies on the default shallow copy constructor and doesn't do a deep copy of the array storing the data?
-
- Posts: 5
- Joined: Tue Nov 18, 2008 8:06 pm
Re: btVector3 Copy Constructor
There is no point trying to outsmart your compiler in terms of making shallow copies and in this case there is no need for anything else since the vector class doesn't allocate any memory in the first place.
-
- Posts: 2
- Joined: Wed Sep 29, 2010 11:55 am
Re: btVector3 Copy Constructor
Thanks. I did some further reading on copy constructors and found out that the default copy constructor copies the elements of static arrays properly - I'd previously thought it didn't.
-
- Posts: 1
- Joined: Mon Dec 28, 2015 6:38 am
Re: btVector3 Copy Constructor
An object copy is a process where a data object has its attributes copied to another object of the same data type. In .Net Shallow copy and deep copy are used for copying data between objects.....more.warmi wrote:There is no point trying to outsmart your compiler in terms of making shallow copies and in this case there is no need for anything else since the vector class doesn't allocate any memory in the first place.
William