winrt::throw_last_error function (C++/WinRT)
A helper function that calls GetLastError to retrieve the calling thread's last-error code value, then calls the winrt::throw_hresult function to throw an exception that represents that error code. Also see winrt::hresult_error.
Syntax
[[noreturn]] inline void throw_last_error();
Requirements
Minimum supported SDK: Windows SDK version 10.0.17134.0 (Windows 10, version 1803)
Namespace: winrt
Header: %WindowsSdkDir%Include<WindowsTargetPlatformVersion>\cppwinrt\winrt\base.h (included by default)