I am trying to get the hang of smart pointers. I have a vector of unique_ptr to double array which I am able to create, but can't access it.
vector<unique_ptr<double[]>> arrDoubles;
//...
unique_ptr<double[]>dataArr(new double[size]);
arrDoubles.push_back(move(dataArr));
Now,
auto datAr = arrDoubles[0];
gives the following :
error: use of deleted function ‘std::unique_ptr<_Tp [], _Dp>::unique_ptr(const std::unique_ptr<_Tp [], _Dp>&) [with _Tp = double; _Dp = std::default_delete<double []>]’