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/make-self below:

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

A factory method that returns a com_ptr to an instance of the implementation type for a runtime class. For an explanation of the implementation type and projected type concepts, see Consume APIs with C++/WinRT and Author APIs with C++/WinRT. Also see make, which returns an instance of the projected type instead.

If you're authoring a runtime class then, from within the same compilation unit, you can use make_self to construct an instance of the implementation type for the runtime class. Assign the return value from make_self to a com_ptr of your implementation type so that you manage the lifetime of the object appropriately.

Also see Opt in to uniform construction, and direct implementation access.

Syntax
template <typename D, typename... Args>
auto make_self(Args&&... args);
Template parameters

typename D The implementation type for a runtime class.

Parameters

args Any constructor arguments for the constructor being invoked.

Return value

A com_ptr to a newly-created instance of the implementation type for the runtime class.

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

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