Skip to content

Commit 647a483

Browse files
authored
Merge pull request #2830 from JohanMabille/has_assign_conversion
Adding fix for incorrect usage of xt::has_assign_conversion in xassig…
2 parents 4a91e4e + 8db2888 commit 647a483

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/xtensor/core/xassign.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ namespace xt
718718
using size_type = typename E1::size_type;
719719
size_type size = e1.size();
720720
constexpr size_type simd_size = simd_type::size;
721-
constexpr bool needs_cast = has_assign_conversion<e1_value_type, e2_value_type>::value;
721+
constexpr bool needs_cast = has_assign_conversion<e2_value_type, e1_value_type>::value;
722722

723723
size_type align_begin = is_aligned ? 0 : xt_simd::get_alignment_offset(e1.data(), size, simd_size);
724724
size_type align_end = align_begin + ((size - align_begin) & ~(simd_size - 1));
@@ -1131,7 +1131,7 @@ namespace xt
11311131
// std::fill(idx.begin(), idx.end(), 0);
11321132
using e1_value_type = typename E1::value_type;
11331133
using e2_value_type = typename E2::value_type;
1134-
constexpr bool needs_cast = has_assign_conversion<e1_value_type, e2_value_type>::value;
1134+
constexpr bool needs_cast = has_assign_conversion<e2_value_type, e1_value_type>::value;
11351135
using value_type = typename xassign_traits<E1, E2>::requested_value_type;
11361136
using simd_type = std::conditional_t<
11371137
std::is_same<e1_value_type, bool>::value,

0 commit comments

Comments
 (0)