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/box-value below:

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

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

In this article

Note

You can box not only scalar values, but also most kinds of arrays (with the exception of arrays of enumerations) by using the winrt::box_value function.

A function template that wraps (or boxes) a scalar or array value inside a reference class object so that it can be passed to a function that expects IInspectable. An overload of the function also exists for winrt::hstring. For more details, and code examples, see Boxing and unboxing values to IInspectable with C++/WinRT.

Syntax
winrt::Windows::Foundation::IInspectable box_value(winrt::hstring const& value);

template <typename T, typename = std::enable_if_t<!std::is_convertible_v<T, winrt::hstring>>>
winrt::Windows::Foundation::IInspectable box_value(T const& value);
Template parameters

typename T A scalar or array type.

Parameters

value A scalar or array value to box.

Return value

A reference class object containing the boxed value.

Requirements

Minimum supported SDK: Windows SDK version 10.0.17134.0 (Windows 10, version 1803)

Namespace: winrt

Header: %WindowsSdkDir%Include<WindowsTargetPlatformVersion>\cppwinrt\winrt\Windows.Foundation.h

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