win32/handle: make HANDLE constructor explicit

This commit is contained in:
Danny Robson 2016-08-25 12:03:48 +10:00
parent eb05746a21
commit 41a8efa200
2 changed files with 2 additions and 6 deletions

View File

@ -70,9 +70,5 @@ handle::reset (HANDLE rhs)
handle handle
handle::current_process (void) handle::current_process (void)
{ {
auto process = GetCurrentProcess (); return handle (GetCurrentProcess ());
if (!process)
util::win32_error::throw_code ();
return process;
} }

View File

@ -19,7 +19,7 @@
namespace util { namespace win32 { namespace util { namespace win32 {
struct handle { struct handle {
handle (); handle ();
handle (HANDLE&&); explicit handle (HANDLE&&);
handle (handle&&); handle (handle&&);
handle (const handle&) = delete; handle (const handle&) = delete;
~handle (); ~handle ();