Open leejy12 opened 1 year ago
The method signatures in our API docs are generated from data in the Windows SDK, not authored manually by us. If you're certain that this a problem between what's displayed for C++/WinRT and how the functions actually operate, I can investigate the back-end causes of this further? But the nature of our publication process means that these details should, in theory, be accurate.
Thanks for bringing this to my attention.
I'm certain the API is documented incorrectly. I'm not sure which data from the Windows SDK is used to generate the docs but here are the functions in the header file C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\cppwinrt\winrt\windows.data.json.h
and they correctly use &
not const &&
.
inline auto JsonArray::TryParse(param::hstring const& input, winrt::Windows::Data::Json::JsonArray& result)
{
return impl::call_factory<JsonArray, IJsonArrayStatics>([&](IJsonArrayStatics const& f) { return f.TryParse(input, result); });
}
inline auto JsonObject::TryParse(param::hstring const& input, winrt::Windows::Data::Json::JsonObject& result)
{
return impl::call_factory<JsonObject, IJsonObjectStatics>([&](IJsonObjectStatics const& f) { return f.TryParse(input, result); });
}
inline auto JsonValue::TryParse(param::hstring const& input, winrt::Windows::Data::Json::JsonValue& result)
{
return impl::call_factory<JsonValue, IJsonValueStatics>([&](IJsonValueStatics const& f) { return f.TryParse(input, result); });
}
Thank you for looking into this!
In each function,
result
should be a non-const lvalue reference, notconst& &
;From:
To:
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.