File tree 3 files changed +16
-13
lines changed
3 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -456,16 +456,21 @@ namespace xt
456
456
constexpr bool simd_strided_assign = traits::simd_strided_assign ();
457
457
if (linear_assign)
458
458
{
459
- if (simd_linear_assign || traits::simd_linear_assign (de1, de2))
460
- {
461
- // Do not use linear_assigner<true> here since it will make the compiler
462
- // instantiate this branch even if the runtime condition is false, resulting
463
- // in compilation error for expressions that do not provide a SIMD interface.
464
- // simd_assign is true if simd_linear_assign() or simd_linear_assign(de1, de2)
465
- // is true.
466
- linear_assigner<simd_assign>::run (de1, de2);
467
- }
468
- else
459
+ // Do not use linear_assigner<true> here since it will make the compiler
460
+ // instantiate this branch even if the runtime condition is false, resulting
461
+ // in compilation error for expressions that do not provide a SIMD interface.
462
+ // simd_assign is true if simd_linear_assign() or simd_linear_assign(de1, de2)
463
+ // is true.
464
+ if constexpr (simd_assign) {
465
+ if (simd_linear_assign || traits::simd_linear_assign (de1, de2))
466
+ {
467
+ linear_assigner<true >::run (de1, de2);
468
+ }
469
+ else
470
+ {
471
+ linear_assigner<false >::run (de1, de2);
472
+ }
473
+ } else
469
474
{
470
475
linear_assigner<false >::run (de1, de2);
471
476
}
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ namespace xt
153
153
(L == layout_type::row_major) || (L == layout_type::column_major),
154
154
" Layout not supported for fixed array"
155
155
);
156
- #if (_MSC_VER >= 1910)
156
+ #if (defined(_MSC_VER_) && _MSC_VER >= 1910)
157
157
using temp_type = std::index_sequence<X...>;
158
158
return R ({workaround::get_computed_strides<L, I, temp_type>(shape[I] == 1 )...});
159
159
#else
Original file line number Diff line number Diff line change @@ -1242,7 +1242,6 @@ namespace xt
1242
1242
template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL, class E >
1243
1243
inline auto argmin (const xexpression<E>& e)
1244
1244
{
1245
- using value_type = typename E::value_type;
1246
1245
auto && ed = eval (e.derived_cast ());
1247
1246
auto begin = ed.template begin <L>();
1248
1247
auto end = ed.template end <L>();
@@ -1272,7 +1271,6 @@ namespace xt
1272
1271
template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL, class E >
1273
1272
inline auto argmax (const xexpression<E>& e)
1274
1273
{
1275
- using value_type = typename E::value_type;
1276
1274
auto && ed = eval (e.derived_cast ());
1277
1275
auto begin = ed.template begin <L>();
1278
1276
auto end = ed.template end <L>();
You can’t perform that action at this time.
0 commit comments