I was wondering if there is a way to use unique_ptr with Windows HANDLEs?
I was thinking to replace the std::default_delete with s
You must use CloseHandle() to "close" a handle instead using delete. They will be deleted by Windows as soon as they are not opened elsewhere. So you could write a wrapper that calls CloseHandle() instead of deleteing it. You could also write your own smartpointer class which might be better as there is no need of a wrapper anymore.