Upravit

Sdílet prostřednictvím


winrt::cloaked marker struct template (C++/WinRT)

A marker template used to indicate to the winrt::implements struct template that an implemented interface should not be included in the list of interfaces returned by the IInspectable::GetIids method (that is, the implemented interface should be "cloaked").

Syntax

template<typename T>
struct cloaked;

Remarks

By default, the implementation of IInspectable::GetIids reports all interfaces that derive from IInspectable. Use the cloaked marker template to indicate that a specific interface should be removed from that list.

Examples

This first example applies when you derive directly from implements.

struct MyImplementation : implementation<MyImplementation, IFrameworkViewSource, cloaked<IStringable>>
{
    ...
};

This next example is for when you're authoring a runtime class.

struct BookSku : BookSkuT<BookSku, cloaked<IStringable>>
{
    ...
};

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