I am trying to use smart pointers like auto_ptr, shared_ptr. However, I do not know how to use it in this situation.
CvMemStorage * storage = cvCreateMemStorage (); ... Use the indicator ... cvReleaseMemStorage (and archive);
I'm not sure, but I think the storage variable is just a malloc'ed memory, not a C ++ class object what to use smart pointers for storage variables The way?
Thank you.
shared_ptr
allows you to specify a custom delocress, however, Seeing cvReleaseMemStorage () is not the correct form of
( zero f (T *)
) and you need a cover:
zero myCvReleaseMemStorage (CvMemStorage * p) {cvReleaseMemStorage (& amp; P); } Share_ptr & lt; CvMemStorage & gt; Sp (cvCreateMemStorage (), and myCvReleaseMemStorage);
Comments
Post a Comment