microsoft / cppwinrt

C++/WinRT
MIT License
1.64k stars 236 forks source link

Support for std::span for winrt::array_view and winrt::com_array #1343

Closed jonwis closed 1 year ago

jonwis commented 1 year ago

This fixes #1289 per "option C" by completing what #1331 started.

@JaiganeshKumaran thank you for the initial start - see if this meets your needs, please.

kennykerr commented 1 year ago

Hopefully @DefaultRyan can spare a few minutes to look this over. He probably has the best handle on the standard library best practices.

dmachaj commented 1 year ago

Sorry I'm a little late to the party. Do these new methods affect vtable layout at all? In other words, does span support need an ODR pragma to prevent mismatches?

kennykerr commented 1 year ago

Do these new methods affect vtable layout at all?

std::span is not an ABI type.

jonwis commented 1 year ago

It's pure conversion methods; no change to the layout or functionality of array_view or com_array here.