We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c39618 commit 2ab174cCopy full SHA for 2ab174c
Common/CmdLineHelpers.h
@@ -26,6 +26,10 @@
26
27
namespace Helpers
28
{
29
+ struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };
30
+
31
+ using ScopedHandle = std::unique_ptr<void, handle_closer>;
32
33
inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
34
35
struct find_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };
0 commit comments