diff --git a/strings/base_reference_produce.h b/strings/base_reference_produce.h index 8ea2de5b9..d7ce558c8 100644 --- a/strings/base_reference_produce.h +++ b/strings/base_reference_produce.h @@ -509,12 +509,12 @@ namespace winrt::impl WINRT_EXPORT namespace winrt { - inline Windows::Foundation::IInspectable box_value(param::hstring const& value) + inline Windows::Foundation::IInspectable box_value(hstring value) { - return Windows::Foundation::IReference(*(hstring*)(&value)); + return Windows::Foundation::IReference(std::move(value)); } - template , int> = 0> + template , int> = 0> Windows::Foundation::IInspectable box_value(T const& value) { if constexpr (std::is_base_of_v)