File tree Expand file tree Collapse file tree 5 files changed +18
-15
lines changed Expand file tree Collapse file tree 5 files changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -456,16 +456,21 @@ namespace xt
456456 constexpr bool simd_strided_assign = traits::simd_strided_assign ();
457457 if (linear_assign)
458458 {
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
469474 {
470475 linear_assigner<false >::run (de1, de2);
471476 }
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ namespace xt
153153 (L == layout_type::row_major) || (L == layout_type::column_major),
154154 " Layout not supported for fixed array"
155155 );
156- #if (_MSC_VER >= 1910)
156+ #if (defined(_MSC_VER_) && _MSC_VER >= 1910)
157157 using temp_type = std::index_sequence<X...>;
158158 return R ({workaround::get_computed_strides<L, I, temp_type>(shape[I] == 1 )...});
159159#else
Original file line number Diff line number Diff line change @@ -1091,7 +1091,7 @@ namespace xt
10911091#define XTENSOR_GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
10921092
10931093// 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)
10951095#define XTENSOR_DISABLE_LAMBDA_FCT
10961096#endif
10971097
Original file line number Diff line number Diff line change @@ -1242,7 +1242,6 @@ namespace xt
12421242 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL, class E >
12431243 inline auto argmin (const xexpression<E>& e)
12441244 {
1245- using value_type = typename E::value_type;
12461245 auto && ed = eval (e.derived_cast ());
12471246 auto begin = ed.template begin <L>();
12481247 auto end = ed.template end <L>();
@@ -1272,7 +1271,6 @@ namespace xt
12721271 template <layout_type L = XTENSOR_DEFAULT_TRAVERSAL, class E >
12731272 inline auto argmax (const xexpression<E>& e)
12741273 {
1275- using value_type = typename E::value_type;
12761274 auto && ed = eval (e.derived_cast ());
12771275 auto begin = ed.template begin <L>();
12781276 auto end = ed.template end <L>();
Original file line number Diff line number Diff line change 3030
3131#include " xtensor_config.hpp"
3232
33- #if (_MSC_VER >= 1910)
33+ #if (defined(_MSC_VER) && _MSC_VER >= 1910)
3434#define NOEXCEPT (T )
3535#else
3636#define NOEXCEPT (T ) noexcept (T)
You can’t perform that action at this time.
0 commit comments