9 #ifndef CPPCOMMON_UTILITY_RESOURCE_H
10 #define CPPCOMMON_UTILITY_RESOURCE_H
42 template <
typename T,
typename TCleaner>
45 return std::unique_ptr<typename std::remove_pointer<T>::type, TCleaner>(handle, cleaner);
53 template <
typename TCleaner>
56 return std::unique_ptr<void, TCleaner>(handle, cleaner);
63 template <
typename TCleaner>
66 return std::unique_ptr<void, TCleaner>(&cleaner, cleaner);
C++ Common project definitions.
auto resource(T handle, TCleaner cleaner)
Resource smart cleaner pattern.