X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fmake-unique-wrapper.hpp;h=a0a4b541a2fd64bc7c01da8babd6b5c01bb54d5c;hb=c91ccadee5bfbc94a95540e17c879ce976caf6a2;hp=e49e5ced779e5bc8343b32c8e4f402625555da9a;hpb=f053d40c60b9dd38da27d88412dcac3a8404324c;p=lttng-tools.git diff --git a/src/common/make-unique-wrapper.hpp b/src/common/make-unique-wrapper.hpp index e49e5ced7..a0a4b541a 100644 --- a/src/common/make-unique-wrapper.hpp +++ b/src/common/make-unique-wrapper.hpp @@ -34,7 +34,7 @@ namespace lttng { * 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. */ @@ -53,7 +53,6 @@ struct create_deleter_class { return std::unique_ptr(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 std::unique_ptr::deleter> -make_unique_wrapper(WrappedType *instance) +make_unique_wrapper(WrappedType *instance = nullptr) { const memory::create_deleter_class unique_deleter;