diff --git a/include/MacStd/common.hpp b/include/MacStd/common.hpp index 8d4dda3..00d340a 100644 --- a/include/MacStd/common.hpp +++ b/include/MacStd/common.hpp @@ -6,6 +6,7 @@ #pragma once #include +#include /// /// Declares a class as non-copyable @@ -54,7 +55,7 @@ namespace macstd /// /// \param[in] h Initial object handle value /// - handle(_In_opt_ T h) noexcept : m_h(h) + handle(T h) noexcept : m_h(h) {} /// @@ -83,7 +84,7 @@ namespace macstd /// /// \param[in] h Object handle value /// - handle& operator=(_In_opt_ T h) noexcept + handle& operator=(T h) noexcept { attach(h); return *this; @@ -193,7 +194,7 @@ namespace macstd /// - Non zero when object handle is less than h; /// - Zero otherwise. /// - bool operator<(_In_opt_ T h) const + bool operator<(T h) const { return m_h < h; } @@ -206,7 +207,7 @@ namespace macstd /// - Non zero when object handle is less than or equal to h; /// - Zero otherwise. /// - bool operator<=(_In_opt_ T h) const + bool operator<=(T h) const { return !operator>(h); } @@ -219,7 +220,7 @@ namespace macstd /// - Non zero when object handle is greater than or equal to h; /// - Zero otherwise. /// - bool operator>=(_In_opt_ T h) const + bool operator>=(T h) const { return !operator<(h); } @@ -232,7 +233,7 @@ namespace macstd /// - Non zero when object handle is greater than h; /// - Zero otherwise. /// - bool operator>(_In_opt_ T h) const + bool operator>(T h) const { return h < m_h; } @@ -245,7 +246,7 @@ namespace macstd /// - Non zero when object handle is not equal to h; /// - Zero otherwise. /// - bool operator!=(_In_opt_ T h) const + bool operator!=(T h) const { return !operator==(h); } @@ -258,7 +259,7 @@ namespace macstd /// - Non zero when object handle is equal to h; /// - Zero otherwise. /// - bool operator==(_In_opt_ T h) const + bool operator==(T h) const { return m_h == h; } @@ -280,7 +281,7 @@ namespace macstd /// /// \param[in] h New object handle /// - void attach(_In_opt_ T h) noexcept + void attach(T h) noexcept { if (m_h != TR::invalid) TR::free(m_h); @@ -292,7 +293,7 @@ namespace macstd /// /// \param[in] h Object handle of existing object /// - void attach_duplicated(_In_opt_ T h) + void attach_duplicated(T h) { if (this->m_h != TR::invalid) TR::free(this->m_h); @@ -353,7 +354,7 @@ namespace macstd /// \param[in] num Numeric error code /// \param[in] msg Error message /// - num_runtime_error(error_type num, _In_z_ const char *msg) : + num_runtime_error(error_type num, const char *msg) : m_num(num), runtime_error(msg) {}