A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://learn.microsoft.com/en-us/uwp/cpp-ref-for-winrt/error-handling/check-pointer below:

winrt::check_pointer function template (C++/WinRT) - Windows UWP applications

winrt::check_pointer function template (C++/WinRT)

In this article

A helper function that checks whether a pointer is null and, if so, calls the winrt::throw_last_error function to retrieve the calling thread's last-error code value, and throw an exception using a C++/WinRT object that represents that error code. Also see winrt::hresult_error.

Syntax
template<typename T>
T* check_pointer(T* pointer);
Template parameters

typename T The type of the pointer to check.

Parameters

pointer A pointer value to check for null. An exception is thrown only if pointer is null.

Return value

A valid pointer; a value is returned only if an exception is not thrown, therefore the pointer is valid.

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)

See also

Additional resources

In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4