a smart pointer to a handle

Nov 5, 2014 at 11:37 PM
in my project, one of data types is a std::unique_str<double[]>. The reason that I use std::unique_str<double[]> instead of std::vector<double> is that I want to use an if statement to check if the variable is nullptr.

I am trying to put a smart pointer to a handle.
std::unique_ptr<double[]> a// say a is returned from a function
handle<std::unique_ptr<double> > h=new std::unique_ptr<double[]> (a);
But the above code doesn't work.

Is there a way to put a smarter pointer to a handle or a raw pointer to a handle?

Many thanks
Martingale
Coordinator
Nov 5, 2014 at 11:59 PM
Don't use std::unique_ptr as a handle type. It was not designed for that.