Created
February 24, 2014 05:35
-
-
Save markusl/9182479 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct handle_deleter_t | |
{ | |
void operator()(HANDLE handle) { | |
if(handle != INVALID_HANDLE_VALUE) | |
CloseHandle(handle); | |
} | |
}; | |
void foo() | |
{ | |
std::unique_ptr<std::remove_pointer<HANDLE>::type, handle_deleter_t> HandlePtr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment