Skip to content

Maps (propertysets) of K to Object could get an unboxing [Try]Lookup #427

Description

@jonwis

There's a bunch of code like this:

ValueSet v = /* ... */
auto g = winrt::unbox_value<winrt::guid>(v.Lookup(L"someKey"));
auto q = winrt::unbox_value_or<winrt::hstring>(v.TryLookup(L"anotherKey"), winrt::hstring{});

It'd be neat if 'unbox object to type' was directly supported so I could have written:

ValueSet v = /* ... */
auto g = v.Lookup<winrt::guid>(L"someKey");
auto q = v.TryLookup<winrt::hstring>(L"anotherKey");

Metadata

Metadata

Assignees

No one assigned

    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