std::unique_ptr is used to replace
When you say
unique_ptr constructor expects to receive a
CreateMutex returns a
HANDLE, not a
we can use
std::remove_pointer to get to the
HANDLE‘s underlying type.
When use it in windows API and deal with
HANDLE, we need a different method to construct it using lambda delter and
decltype to deduce the type of the function pointer.