Skip to content

box_value constructor: Replace param::hstring with hstring#1530

Open
justanotheranonymoususer wants to merge 2 commits intomicrosoft:masterfrom
justanotheranonymoususer:box-
Open

box_value constructor: Replace param::hstring with hstring#1530
justanotheranonymoususer wants to merge 2 commits intomicrosoft:masterfrom
justanotheranonymoususer:box-

Conversation

@justanotheranonymoususer

Partial fix for #1527.

Other places remain unfixed, example:

unbox_value_or(boxed, ReturnsStringView());

Or any other param::hstring usage.

@github-actions

This comment was marked as resolved.

@justanotheranonymoususer

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@justanotheranonymoususer

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@justanotheranonymoususer

This comment was marked as resolved.

@github-actions

This comment was marked as resolved.

@sylveon
Copy link
Contributor

sylveon commented Mar 20, 2026

@DefaultRyan This PR is a good one - box_value will always do a copy of the hstring so we might as well skip the param::hstring here.

@DefaultRyan DefaultRyan self-assigned this Mar 20, 2026
@DefaultRyan
Copy link
Member

This breaks boxing of string-like types such as std::wstring and std::wstring_view via conversion to param::hstring.

I think we can still do this with a little more finesse. One idea of the top of my head is to have an exact hstring overload, and an overload for string-like types that are convertible to param::hstring. For the second overload, we don't actually create a param::hstring, but explicitly construct a fully-fledged hstring instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants