projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
format-cpp: run clang-format in parallel
[lttng-tools.git]
/
src
/
common
/
make-unique-wrapper.hpp
diff --git
a/src/common/make-unique-wrapper.hpp
b/src/common/make-unique-wrapper.hpp
index 9381ce9711d2b57a257310bc52217d239995fc13..ebec2ca45d29a908a648d398a5a8dfba516afa9f 100644
(file)
--- a/
src/common/make-unique-wrapper.hpp
+++ b/
src/common/make-unique-wrapper.hpp
@@
-38,9
+38,9
@@
namespace lttng {
* a proper, idiomatic, wrapper.
*/
* a proper, idiomatic, wrapper.
*/
-namespace
details
{
+namespace
memory
{
template <typename WrappedType, void (*DeleterFunction)(WrappedType *)>
template <typename WrappedType, void (*DeleterFunction)(WrappedType *)>
-struct create_
unique
_class {
+struct create_
deleter
_class {
struct deleter {
void operator()(WrappedType *instance) const
{
struct deleter {
void operator()(WrappedType *instance) const
{
@@
-53,7
+53,7
@@
struct create_unique_class {
return std::unique_ptr<WrappedType, deleter>(instance);
}
};
return std::unique_ptr<WrappedType, deleter>(instance);
}
};
-} /* namespace
details
*/
+} /* namespace
memory
*/
/*
* 'free' is a utility function for use with make_unique_wrapper. It makes it easier to
/*
* '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 <typename WrappedType, void (*DeleterFunc)(WrappedType *)>
std::unique_ptr<WrappedType,
template <typename WrappedType, void (*DeleterFunc)(WrappedType *)>
std::unique_ptr<WrappedType,
- typename
details::create_unique
_class<WrappedType, DeleterFunc>::deleter>
-make_unique_wrapper(WrappedType *instance)
+ typename
memory::create_deleter
_class<WrappedType, DeleterFunc>::deleter>
+make_unique_wrapper(WrappedType *instance
= nullptr
)
{
{
- const
details::create_unique
_class<WrappedType, DeleterFunc> unique_deleter;
+ const
memory::create_deleter
_class<WrappedType, DeleterFunc> unique_deleter;
return unique_deleter(instance);
}
return unique_deleter(instance);
}
This page took
0.023821 seconds
and
4
git commands to generate.