Skip to content

Commit 2ab174c

Browse files
committed
Sync
1 parent 9c39618 commit 2ab174c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Common/CmdLineHelpers.h

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626

2727
namespace Helpers
2828
{
29+
struct handle_closer { void operator()(HANDLE h) { if (h) CloseHandle(h); } };
30+
31+
using ScopedHandle = std::unique_ptr<void, handle_closer>;
32+
2933
inline HANDLE safe_handle(HANDLE h) noexcept { return (h == INVALID_HANDLE_VALUE) ? nullptr : h; }
3034

3135
struct find_closer { void operator()(HANDLE h) noexcept { assert(h != INVALID_HANDLE_VALUE); if (h) FindClose(h); } };

0 commit comments

Comments
 (0)