File tree 5 files changed +18
-15
lines changed
5 files changed +18
-15
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 @@ -1091,7 +1091,7 @@ namespace xt
1091
1091
#define XTENSOR_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
1092
1092
1093
1093
// Workaround for MSVC 2015 & GCC 4.9
1094
- #if (defined(_MSC_VER) && _MSC_VER < 1910) || (defined(__GNUC__) && GCC_VERSION < 49999)
1094
+ #if (defined(_MSC_VER) && _MSC_VER < 1910) || (defined(__GNUC__) && XTENSOR_GCC_VERSION < 49999)
1095
1095
#define XTENSOR_DISABLE_LAMBDA_FCT
1096
1096
#endif
1097
1097
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>();
Original file line number Diff line number Diff line change 30
30
31
31
#include " xtensor_config.hpp"
32
32
33
- #if (_MSC_VER >= 1910)
33
+ #if (defined(_MSC_VER) && _MSC_VER >= 1910)
34
34
#define NOEXCEPT (T )
35
35
#else
36
36
#define NOEXCEPT (T ) noexcept (T)
You can’t perform that action at this time.
0 commit comments