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.
Syntaxwinrt::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.
value
A scalar or array value to box.
A reference class object containing the boxed value.
RequirementsMinimum 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 alsoWas 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