winrt::name_of function template (C++/WinRT)
A helper function that retrieves a string view containing the fully-qualified type name of a particular Windows Runtime class.
name_of works best with a projected type. If you specify an implementation type, then name_of returns the stringified GUID of the default interface.
template <typename T>
constexpr auto name_of() noexcept;
typename T
A projected interface or runtime class type.
A string view with a null-terminator beyond the end.
if (ApiInformation.IsMethodPresent(
winrt::name_of<Windows::Devices::PointOfService::ReceiptPrintJob>(),
L"FeedPaperByLine")) {
...
}
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)