Skip to content

Unable to initialize winrt::hstring using nullptr #1898

@trenthoppe

Description

@trenthoppe

When attempting to initialize a null winrt::hstring using the documented syntax:

winrt::hstring{ nullptr }

I receive - Error C228 'winrt::hstring::hstring(std::nullptr_t)': attempting to reference a deleted function.

If I initialize it using an empty string: L"", which is identical to null, it works fine. Is this the correct way to initialize a null winrt::hstring? Or is this unintended behavior?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions