Skip to content

Conversation

@jonwis
Copy link
Member

@jonwis jonwis commented Aug 19, 2023

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

  • Constructors for both array_view and com_array that take a span
  • Conversions on both array_view and com_array that produce a span
  • Tests for the conversions and constructions
  • Additional ctad support for easy use

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

@jonwis jonwis requested review from dmachaj and kennykerr August 19, 2023 04:04
@kennykerr
Copy link
Collaborator

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

@jonwis jonwis requested review from ChrisGuzak and kennykerr August 28, 2023 04:54
Copy link
Collaborator

@kennykerr kennykerr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think the lifetime here is bonkers, but admittedly not any worse than the C++ standard library.

@jonwis jonwis merged commit 691f6f8 into microsoft:master Aug 28, 2023
@jonwis jonwis deleted the user/jonwis/update-juv-studios branch August 28, 2023 17:24
@dmachaj
Copy link
Contributor

dmachaj commented Aug 28, 2023

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
Copy link
Collaborator

Do these new methods affect vtable layout at all?

std::span is not an ABI type.

@jonwis
Copy link
Member Author

jonwis commented Aug 28, 2023

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

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.

Allow passing array_view as span

5 participants