Skip to content

Conversation

@JMazurkiewicz
Copy link
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.

@JMazurkiewicz JMazurkiewicz requested a review from a team as a code owner June 19, 2023 15:21
@StephanTLavavej StephanTLavavej added the mdspan C++23 mdspan label Jun 19, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jun 20, 2023
@StephanTLavavej StephanTLavavej removed their assignment Jun 21, 2023
@StephanTLavavej StephanTLavavej merged commit 652e2b0 into microsoft:feature/mdspan2 Jun 21, 2023
@StephanTLavavej
Copy link
Member

Looks great, thank you! ✨

@JMazurkiewicz JMazurkiewicz deleted the mdspan/extents-enhancements branch June 21, 2023 08:32
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