MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / unique_ptr

Function unique_ptr

libcommonutil/commonutil.h:79–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77 */
78 template<typename Type, typename Deleter, typename ...Arguments>
79 auto unique_ptr(Deleter&& deleter, Arguments&& ...args)
80 {
81 auto create_object = [](Arguments&& ...args) {
82
83 if (sizeof ...(args) == 0) {
84 return new Type();
85 } else {
86 return new Type(std::forward<Arguments>(args)...);
87 }
88 };
89
90 return unique_rsc(std::move(create_object),
91 std::forward<Deleter>(deleter),
92 std::forward<Arguments>(args)...);
93 }
94
95 /*
96 * This function takes a type,a deleter for the type and optional arguments the

Callers 1

readMethod · 0.85

Calls 1

unique_rscFunction · 0.85

Tested by

no test coverage detected