diff options
Diffstat (limited to 'c/common.h')
-rw-r--r-- | c/common.h | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -42,6 +42,12 @@ T* Library::GetProcAddress(const char* const szProc) return (T*)(void*)::GetProcAddress(m_hModule, szProc); } +template<size_t N, typename... T> +inline auto wszf(wchar_t (&wsz)[N], const wchar_t* wszFmt, T... xs) +{ + return swprintf_s(wsz, N, wszFmt, xs...); +} + /* Create and return an object of type C. If construction fails, * return nothing. The returned value must be checked before being * used, as dereferencing is undefined if the value is empty. */ @@ -57,7 +63,7 @@ std::optional<T> maybe_make(U... xs) /* Variable template for caching values from GetSystemMetrics. */ template <int I> -const auto Metric = GetSystemMetrics(I); +auto Metric = GetSystemMetrics(I); /* Check result of Windows API call, throwing error on NULL. */ template <typename T> |