diff --git a/include/WinStd/Common.h b/include/WinStd/Common.h index 528d63b6..dcebc37b 100644 --- a/include/WinStd/Common.h +++ b/include/WinStd/Common.h @@ -987,18 +987,17 @@ namespace winstd } /// - /// Tests if the object handle is invalid. + /// Tests if the object handle is valid. /// /// \return - /// - Non zero when object handle is invalid; + /// - Non zero when object handle is valid; /// - Zero otherwise. /// /// \note Implementing `operator bool() const` would be correct C++ approach here. Unfortunately, it would produce ambiguities where `bool` and `handle_type` are polymorphed. - /// Use `!!` to test if the object handle is valid. /// - bool operator!() const + bool valid() const { - return m_h == invalid; + return m_h != invalid; } ///