X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Fmake-unique-wrapper.hpp;h=ebec2ca45d29a908a648d398a5a8dfba516afa9f;hb=fe3442d8303182515a02153340291c9f020e24c3;hp=9381ce9711d2b57a257310bc52217d239995fc13;hpb=28f23191dcbf047429d51950a337a57d7a3f866a;p=lttng-tools.git diff --git a/src/common/make-unique-wrapper.hpp b/src/common/make-unique-wrapper.hpp index 9381ce971..ebec2ca45 100644 --- a/src/common/make-unique-wrapper.hpp +++ b/src/common/make-unique-wrapper.hpp @@ -38,9 +38,9 @@ namespace lttng { * a proper, idiomatic, wrapper. */ -namespace details { +namespace memory { template -struct create_unique_class { +struct create_deleter_class { struct deleter { void operator()(WrappedType *instance) const { @@ -53,7 +53,7 @@ struct create_unique_class { return std::unique_ptr(instance); } }; -} /* namespace details */ +} /* namespace memory */ /* * 'free' is a utility function for use with make_unique_wrapper. It makes it easier to @@ -69,10 +69,10 @@ void free(Type *ptr) template std::unique_ptr::deleter> -make_unique_wrapper(WrappedType *instance) + typename memory::create_deleter_class::deleter> +make_unique_wrapper(WrappedType *instance = nullptr) { - const details::create_unique_class unique_deleter; + const memory::create_deleter_class unique_deleter; return unique_deleter(instance); }