shared_array double free problem

22 Jul
2005
22 Jul
'05
5:48 p.m.
Here is the compilable code:
#include

26 Jul
26 Jul
3:36 p.m.
Jack Nguyen wrote:
Here is the compilable code:
<snip>
VectorView(T* ptr, int size) { _size=size; _vp=boost::shared_array<T>(ptr); }
<snip>
int main (void) { double a[]={1,2,3,4,5,6,7}; VectorView<double>V(a,4); std::cout<
Any workaround?
shared_array doesn't copy arrays (that's half the point of using it). You really don't want to delete arrays with automatic storage, so don't pass them to shared_array. Ben.
7207
Age (days ago)
7211
Last active (days ago)
1 comments
2 participants
participants (2)
-
Ben Hutchings
-
Jack Nguyen