* create_my_c_struct());
*
* Note that this facility is intended for use in the scope of a function.
- * If you need to return this unique_ptr instance, you should consider writting
+ * If you need to return this unique_ptr instance, you should consider writing
* a proper, idiomatic, wrapper.
*/
return std::unique_ptr<WrappedType, deleter>(instance);
}
};
-} /* namespace memory */
/*
* 'free' is a utility function for use with make_unique_wrapper. It makes it easier to
{
std::free(ptr);
}
+} /* namespace memory */
template <typename WrappedType, void (*DeleterFunc)(WrappedType *)>
std::unique_ptr<WrappedType,
typename memory::create_deleter_class<WrappedType, DeleterFunc>::deleter>
-make_unique_wrapper(WrappedType *instance)
+make_unique_wrapper(WrappedType *instance = nullptr)
{
const memory::create_deleter_class<WrappedType, DeleterFunc> unique_deleter;