aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/winapi/error.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/winapi/error.hpp')
-rw-r--r--include/winapi/error.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/winapi/error.hpp b/include/winapi/error.hpp
index 8ecd720..35e10f0 100644
--- a/include/winapi/error.hpp
+++ b/include/winapi/error.hpp
@@ -3,6 +3,11 @@
// For details, see https://github.com/egor-tensin/winapi-common.
// Distributed under the MIT License.
+/**
+ * @file
+ * @brief Make `std::system_error` work with `GetLastError()`.
+ */
+
#pragma once
#include <windows.h>
@@ -30,6 +35,11 @@ inline const CategoryWindows& category_windows() {
return instance;
}
+/**
+ * Build a `std::system_error` from the value of `GetLastError()`.
+ * @param code Value of `GetLastError()`.
+ * @param function Name of the function that failed, like "CreateFile".
+ */
std::system_error windows(DWORD code, const char* function);
template <typename Ret>