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::current_process (void)
{
auto process = GetCurrentProcess ();
if (!process)
util::win32_error::throw_code ();
return process;
return handle (GetCurrentProcess ());
}

View File

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