
26 Jul
2005
26 Jul
'05
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.