Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<mdspan>: Cleanup extents's deduction guide #3632

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions stl/inc/mdspan
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,12 @@ public:
}
};

#if defined(__clang__) || defined(__EDG__) // TRANSITION, REQUIRES REPORT (ICE)
template <class... _Integrals>
requires (is_convertible_v<_Integrals, size_t> && ...)
extents(_Integrals... _Exts) -> extents<size_t, ((void) _Exts, dynamic_extent)...>;
#else // ^^^ no workaround / workaround vvv
template <class>
inline constexpr size_t _Repeat_dynamic_extent = dynamic_extent;

template <class... _Integrals>
requires (is_convertible_v<_Integrals, size_t> && ...)
extents(_Integrals...)
-> extents<size_t, conditional_t<true, integral_constant<size_t, dynamic_extent>, _Integrals>::value...>;
#endif // ^^^ workaround ^^^
extents(_Integrals...) -> extents<size_t, _Repeat_dynamic_extent<_Integrals>...>;

template <class _IndexType, class _Indices>
struct _Dextents_impl;
Expand Down
10 changes: 4 additions & 6 deletions tests/std/tests/P0009R18_mdspan_layout_right/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,10 @@ constexpr void check_construction_from_other_left_mapping() {
}

{ // Check implicit conversions
static_assert(!NotImplicitlyConstructibleFrom<layout_right::mapping<extents<int, 3>>,
layout_left::mapping<extents<int, 3>>>);
static_assert(NotImplicitlyConstructibleFrom<layout_right::mapping<extents<int, 3>>,
layout_left::mapping<extents<long long, 3>>>);
static_assert(NotImplicitlyConstructibleFrom<layout_right::mapping<extents<int, 3>>,
layout_left::mapping<extents<int, dynamic_extent>>>);
using Mapping = layout_right::mapping<extents<int, 4>>;
static_assert(!NotImplicitlyConstructibleFrom<Mapping, layout_left::mapping<extents<int, 4>>>);
static_assert(NotImplicitlyConstructibleFrom<Mapping, layout_left::mapping<extents<long long, 4>>>);
static_assert(NotImplicitlyConstructibleFrom<Mapping, layout_left::mapping<extents<int, dynamic_extent>>>);
}
}

Expand Down