Skip to content

<mdspan>: extents improvements - #3786

Merged
Stephan T. Lavavej (StephanTLavavej) merged 13 commits into
microsoft:feature/mdspan2from
JMazurkiewicz:mdspan/extents-enhancements
Jun 21, 2023
Merged

<mdspan>: extents improvements#3786
Stephan T. Lavavej (StephanTLavavej) merged 13 commits into
microsoft:feature/mdspan2from
JMazurkiewicz:mdspan/extents-enhancements

Conversation

@JMazurkiewicz

Copy link
Copy Markdown
Contributor
  • Guard _STL_VERIFY with #if _CONTAINER_DEBUG_LEVEL > 0 (towards <mdspan>: Completely rework std::extents #3586 (comment)). I believe that this is the best solution, because:
    • The checks are cheap,
    • The checks don't require ABI-changing bookkeeping.
  • Improve extents' constructors:
    • extents(other extents) constructor avoids using for loop and uses index_sequence instead,
    • extents(exts...) constructor avoids creating temporary arrays and using for loop. Instead, it puts exts... in a tuple and then constructs _Dynamic_extents array directly,
    • extents(exts...) now always checks elements in exts when it is possible. Previously it checked element when all elements were "checkable" (were integral),
    • extents(span/array) is more efficient.
  • Add extra internal checks in _(Fwd/Rev)_prod_of_extents,
  • Improve test code:
    • Add parentheses around std::min in test_mdspan_support.hpp,
    • Add extra death test to verify new extents(exts...)'s behaviour.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit 652e2b0 into microsoft:feature/mdspan2 Jun 21, 2023
@StephanTLavavej

Copy link
Copy Markdown
Member

Looks great, thank you! ✨

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

Labels

mdspan C++23 mdspan

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants