From 4d5242bfabfae7582a8fe1327d7e43f2d7c98e24 Mon Sep 17 00:00:00 2001 From: Paul Grosse-Bley Date: Tue, 21 May 2024 14:43:46 +0200 Subject: [PATCH] Fix missing restriction on ElementType It needs to be the same as AccessorPolicy::element_type. --- include/experimental/__p0009_bits/mdspan.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/experimental/__p0009_bits/mdspan.hpp b/include/experimental/__p0009_bits/mdspan.hpp index d6ec49e6..af484824 100644 --- a/include/experimental/__p0009_bits/mdspan.hpp +++ b/include/experimental/__p0009_bits/mdspan.hpp @@ -34,6 +34,8 @@ class mdspan private: static_assert(detail::__is_extents_v, MDSPAN_IMPL_STANDARD_NAMESPACE_STRING "::mdspan's Extents template parameter must be a specialization of " MDSPAN_IMPL_STANDARD_NAMESPACE_STRING "::extents."); + static_assert(std::is_same::value, + MDSPAN_IMPL_STANDARD_NAMESPACE_STRING "::mdspan's ElementType template parameter must be the same as its AccessorPolicy::element_type."); // Workaround for non-deducibility of the index sequence template parameter if it's given at the top level template