|| sizeof...(_OIndexTypes) == rank_dynamic())
constexpr explicit extents(_OIndexTypes... __exts) noexcept
: _M_exts(span<const _IndexType, sizeof...(_OIndexTypes)>(
- initializer_list{_S_storage::_S_int_cast(__exts)...}))
+ initializer_list{static_cast<_IndexType>(std::move(__exts))...}))
{ }
template<typename _OIndexType, size_t _Nm>
operator()(_Indices... __indices) const noexcept
{
return __mdspan::__linear_index_left(_M_extents,
- static_cast<index_type>(__indices)...);
+ static_cast<index_type>(std::move(__indices))...);
}
static constexpr bool
operator()(_Indices... __indices) const noexcept
{
return __mdspan::__linear_index_right(
- _M_extents, static_cast<index_type>(__indices)...);
+ _M_extents, static_cast<index_type>(std::move(__indices))...);
}
static constexpr bool
operator()(_Indices... __indices) const noexcept
{
return __mdspan::__linear_index_strides(*this,
- static_cast<index_type>(__indices)...);
+ static_cast<index_type>(std::move(__indices))...);
}
static constexpr bool
test_shape_all<IntLike, true>();
test_shape_all<ThrowingInt, false>();
test_shape_all<MutatingInt, false>();
+ test_shape_all<RValueInt, false>();
test_pack_all<int, true>();
test_pack_all<IntLike, true>();
test_pack_all<ThrowingInt, false>();
+ test_pack_all<MutatingInt, true>();
+ test_pack_all<RValueInt, true>();
return 0;
}
Const,
Throwing,
Mutating,
+ RValue,
};
template<CustomIndexKind Kind>
requires (Kind == CustomIndexKind::Mutating)
{ return _M_i; }
+ constexpr
+ operator int() && noexcept
+ requires (Kind == CustomIndexKind::RValue)
+ { return _M_i; }
+
private:
int _M_i;
};
using IntLike = CustomIndexType<CustomIndexKind::Const>;
using ThrowingInt = CustomIndexType<CustomIndexKind::Throwing>;
using MutatingInt = CustomIndexType<CustomIndexKind::Mutating>;
+using RValueInt = CustomIndexType<CustomIndexKind::RValue>;
struct NotIntLike
{ };
{
test_linear_index_all<Layout, IntLike>();
test_linear_index_all<Layout, MutatingInt>();
+ test_linear_index_all<Layout, RValueInt>();
}
test_required_span_size_all<Layout>();
test_from_int_like<IntLike, true, true>();
test_from_int_like<ThrowingInt, false, false>();
test_from_int_like<MutatingInt, true, false>();
+ test_from_int_like<RValueInt, true, false>();
test_from_opaque_accessor();
test_from_base_class_accessor();
test_access<IntLike, true, true>();
test_access<ThrowingInt, false, false>();
test_access<MutatingInt, true, false>();
+ test_access<RValueInt, true, false>();
test_swap();
static_assert(test_swap());