Skip to content

Commit 005bb0e

Browse files
committed
Restrict cast SIMD to floating-point batches
1 parent 49f9028 commit 005bb0e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎include/xtensor/core/xoperation.hpp‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,10 @@ namespace xt
159159

160160
template <
161161
class B,
162-
std::enable_if_t<std::is_same<R, typename xt_simd::revert_simd_traits<B>::type>::value, int> = 0>
162+
std::enable_if_t<
163+
std::is_floating_point<R>::value
164+
&& std::is_same<R, typename xt_simd::revert_simd_traits<B>::type>::value,
165+
int> = 0>
163166
constexpr B simd_apply(const B& arg) const
164167
{
165168
return arg;

0 commit comments

Comments
 (0)