Move the lttng::free util under the lttng::memory namespace
[lttng-tools.git] / src / common / make-unique-wrapper.hpp
index e49e5ced779e5bc8343b32c8e4f402625555da9a..282181cffa58439b9dd7642949a40701c3b67512 100644 (file)
@@ -53,7 +53,6 @@ struct create_deleter_class {
                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
@@ -66,11 +65,12 @@ void free(Type *ptr)
 {
        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;
 
This page took 0.024403 seconds and 4 git commands to generate.