Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@JMazurkiewicz
Copy link
Contributor

@JMazurkiewicz JMazurkiewicz commented Jun 22, 2023

  • Guard all existing debug checks with #if _CONTAINER_DEBUG_LEVEL > 0 (addresses <mdspan>: Completely rework std::extents #3586 (comment)),
  • extents:
    • Make _Static_extents array public and use it when possible,
    • Add new _Multidim_index_space_size_is_always_zero static member variable,
    • Split _Is_index_space_size_representable into two functions: _Is_static_multidim_index_space_size_representable and _Is_dynamic_multidim_index_space_size_representable,
    • Report DevCom-10398426 and silence it,
    • Improve debug check in extents(_OtherIndexTypes... _Exts) constructor,
  • layout_(left|right|stride)
    • Implement missing debug checks,
    • Replace scary looking immediately invoked lambda expressions with simple for loops (layout_(left|right)'s constructors from layout_stride),
    • Move precondition checks from operator() to corresponding _Index_impl functions (to avoid casting _Indices to index_type twice),
    • Drive-by: Remove unnecessary [[maybe_unused]] attributes in tests,
    • Drive-by: Simplify calls to check_members_with_various_extents in tests,
    • Drive-by: use ranges::adjacent_find instead of views::pairwise_transform in get_mapping_properties function,
    • Drive-by: fix exhaustiveness check in get_mapping_properties - previously, non-unique exhaustive mappings were recognized as non-exhaustive,
  • mdspan:
    • Implement missing debug checks,
    • Manually inline call to extents_type::static_extent in mdspan::static_extent and add precondition check,
    • Drive-by: improve performance of mdspan::empty,
    • Implement new death tests.

@JMazurkiewicz JMazurkiewicz requested a review from a team as a code owner June 22, 2023 17:55
@JMazurkiewicz

This comment was marked as resolved.

@StephanTLavavej StephanTLavavej added the mdspan C++23 mdspan label Jun 22, 2023
Drive-by:
* Remove unnecessary `[[maybe_unused]]` attributes
* Simplify calls to `check_members_with_various_extents`
@JMazurkiewicz

This comment was marked as resolved.

Previously, non-unique exhaustive mappings were rejected.
@StephanTLavavej StephanTLavavej self-assigned this Jun 23, 2023
constexpr array<int, 256> some_ints{};

void test_construction_from_other_mdspan() {
auto mds1 = mdspan{some_ints.data(), 8, 2, 8};
Copy link
Member

Choose a reason for hiding this comment

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

This is an occurrence of "almost always auto" which we conventionally avoid. mdspan mds1{some_ints.data(), 8, 2, 8}; is the preferred form.

Occurs below.

@StephanTLavavej StephanTLavavej merged commit 1984147 into microsoft:feature/mdspan2 Jul 3, 2023
@StephanTLavavej
Copy link
Member

Thank you! I have minor comments for followup but nothing that prevented a merge.

@JMazurkiewicz JMazurkiewicz deleted the mdspan/debug-guards branch July 3, 2023 22:15
JMazurkiewicz added a commit to JMazurkiewicz/STL that referenced this pull request Jul 5, 2023
JMazurkiewicz added a commit to JMazurkiewicz/STL that referenced this pull request Jul 5, 2023
JMazurkiewicz added a commit to JMazurkiewicz/STL that referenced this pull request Jul 5, 2023
JMazurkiewicz added a commit to JMazurkiewicz/STL that referenced this pull request Jul 5, 2023
JMazurkiewicz added a commit to JMazurkiewicz/STL that referenced this pull request Jul 7, 2023
JMazurkiewicz added a commit to JMazurkiewicz/STL that referenced this pull request Jul 7, 2023
JMazurkiewicz added a commit to JMazurkiewicz/STL that referenced this pull request Jul 7, 2023
JMazurkiewicz added a commit to JMazurkiewicz/STL that referenced this pull request Jul 7, 2023
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