: mapping(__other.extents(), __mdspan::__internal_ctor{})
{ }
- template<class _OExtents>
+ template<typename _OExtents>
requires (extents_type::rank() <= 1)
&& is_constructible_v<extents_type, _OExtents>
constexpr explicit(!is_convertible_v<_OExtents, extents_type>)
: mapping(__other.extents(), __mdspan::__internal_ctor{})
{ }
- template<class _OExtents>
+ template<typename _OExtents>
requires is_constructible_v<extents_type, _OExtents>
constexpr explicit(extents_type::rank() > 0)
mapping(const layout_stride::mapping<_OExtents>& __other) noexcept
namespace __mdspan
{
- template<typename M>
+ template<typename _Mp>
concept __mapping_alike = requires
{
- requires __is_extents<typename M::extents_type>;
- { M::is_always_strided() } -> same_as<bool>;
- { M::is_always_exhaustive() } -> same_as<bool>;
- { M::is_always_unique() } -> same_as<bool>;
- bool_constant<M::is_always_strided()>::value;
- bool_constant<M::is_always_exhaustive()>::value;
- bool_constant<M::is_always_unique()>::value;
+ requires __is_extents<typename _Mp::extents_type>;
+ { _Mp::is_always_strided() } -> same_as<bool>;
+ { _Mp::is_always_exhaustive() } -> same_as<bool>;
+ { _Mp::is_always_unique() } -> same_as<bool>;
+ bool_constant<_Mp::is_always_strided()>::value;
+ bool_constant<_Mp::is_always_exhaustive()>::value;
+ bool_constant<_Mp::is_always_unique()>::value;
};
template<typename _Mapping>
mapping() noexcept
{
// The precondition is either statically asserted, or automatically
- // satisfied because dynamic extents are zero-initialzied.
+ // satisfied because dynamic extents are zero-initialized.
size_t __stride = 1;
for (size_t __i = extents_type::rank(); __i > 0; --__i)
{
};
template<size_t Count, typename Layout, typename OLayout>
- struct B
+ bool
+ B()
{
using Extents = std::extents<uint8_t, dyn, dyn, Count>;
using OExtents = std::extents<uint16_t, n, 4, Count>;
using OMapping = typename OLayout::mapping<OExtents>;
Mapping m{OMapping{}};
+ return true;
};
A<std::layout_left> a_left; // { dg-error "required from" }
A<std::layout_right> a_right; // { dg-error "required from" }
A<std::layout_stride> a_stride; // { dg-error "required from" }
-B<1, std::layout_left, std::layout_left> b0; // { dg-error "required here" }
-B<2, std::layout_left, std::layout_stride> b1; // { dg-error "required here" }
+auto b1 = B<1, std::layout_left, std::layout_left>(); // { dg-error "required from" }
+auto b2 = B<2, std::layout_left, std::layout_stride>(); // { dg-error "required from" }
-B<3, std::layout_right, std::layout_right> b2; // { dg-error "required here" }
-B<4, std::layout_right, std::layout_stride> b3; // { dg-error "required here" }
+auto b3 = B<3, std::layout_right, std::layout_right>(); // { dg-error "required from" }
+auto b4 = B<4, std::layout_right, std::layout_stride>(); // { dg-error "required from" }
-B<5, std::layout_stride, std::layout_right> b4; // { dg-error "required here" }
-B<6, std::layout_stride, std::layout_left> b5; // { dg-error "required here" }
-B<7, std::layout_stride, std::layout_stride> b6; // { dg-error "required here" }
+auto b5 = B<5, std::layout_stride, std::layout_right>(); // { dg-error "required from" }
+auto b6 = B<6, std::layout_stride, std::layout_left>(); // { dg-error "required from" }
+auto b7 = B<7, std::layout_stride, std::layout_stride>(); // { dg-error "required from" }
// { dg-prune-output "must be representable as index_type" }