diff --git a/include/xsimd/types/xsimd_api.hpp b/include/xsimd/types/xsimd_api.hpp index 9eaf4bbcd..5898b1011 100644 --- a/include/xsimd/types/xsimd_api.hpp +++ b/include/xsimd/types/xsimd_api.hpp @@ -2124,6 +2124,7 @@ namespace xsimd shuffle(batch const& x, batch const& y, batch_constant mask) noexcept { static_assert(sizeof(T) == sizeof(Vt), "consistent mask"); + static_assert(std::is_unsigned::value, "mask must hold unsigned indices"); detail::static_check_supported_config(); return kernel::shuffle(x, y, mask, A {}); } @@ -2433,6 +2434,7 @@ namespace xsimd XSIMD_INLINE batch, A> swizzle(batch, A> const& x, batch_constant mask) noexcept { static_assert(sizeof(T) == sizeof(Vt), "consistent mask"); + static_assert(std::is_unsigned::value, "mask must hold unsigned indices"); detail::static_check_supported_config(); return kernel::swizzle(x, mask, A {}); }