Skip to content

Commit f77c13f

Browse files
authored
Merge pull request #2528 from borisfom/edg-workaround
Workaround for EDG C++ frontend bug
2 parents 1412daa + 85c8194 commit f77c13f

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

include/xtensor/xarray.hpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ namespace xt
377377
: base_type()
378378
{
379379
base_type::resize(xt::shape<shape_type>(t));
380-
L == layout_type::row_major ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<layout_type::row_major>(), t);
380+
constexpr auto tmp = layout_type::row_major;
381+
L == tmp ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<tmp>(), t);
381382
}
382383

383384
/**
@@ -389,7 +390,8 @@ namespace xt
389390
: base_type()
390391
{
391392
base_type::resize(xt::shape<shape_type>(t));
392-
L == layout_type::row_major ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<layout_type::row_major>(), t);
393+
constexpr auto tmp = layout_type::row_major;
394+
L == tmp ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<tmp>(), t);
393395
}
394396

395397
/**
@@ -401,7 +403,8 @@ namespace xt
401403
: base_type()
402404
{
403405
base_type::resize(xt::shape<shape_type>(t));
404-
L == layout_type::row_major ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<layout_type::row_major>(), t);
406+
constexpr auto tmp = layout_type::row_major;
407+
L == tmp ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<tmp>(), t);
405408
}
406409

407410
/**
@@ -413,7 +416,8 @@ namespace xt
413416
: base_type()
414417
{
415418
base_type::resize(xt::shape<shape_type>(t));
416-
L == layout_type::row_major ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<layout_type::row_major>(), t);
419+
constexpr auto tmp = layout_type::row_major;
420+
L == tmp ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<tmp>(), t);
417421
}
418422

419423
/**
@@ -425,7 +429,8 @@ namespace xt
425429
: base_type()
426430
{
427431
base_type::resize(xt::shape<shape_type>(t));
428-
L == layout_type::row_major ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<layout_type::row_major>(), t);
432+
constexpr auto tmp = layout_type::row_major;
433+
L == tmp ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<tmp>(), t);
429434
}
430435
//@}
431436

include/xtensor/xfixed.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,8 @@ namespace xt
629629
inline xfixed_container<ET, S, L, SH, Tag>::xfixed_container(nested_initializer_list_t<value_type, N> t)
630630
{
631631
XTENSOR_ASSERT_MSG(detail::check_initializer_list_shape<N>::run(t, this->shape()) == true, "initializer list shape does not match fixed shape");
632-
L == layout_type::row_major ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<layout_type::row_major>(), t);
632+
constexpr auto tmp = layout_type::row_major;
633+
L == tmp ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<tmp>(), t);
633634
}
634635
//@}
635636

include/xtensor/xtensor.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ namespace xt
425425
: base_type()
426426
{
427427
base_type::resize(xt::shape<shape_type>(t), true);
428-
L == layout_type::row_major ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<layout_type::row_major>(), t);
428+
constexpr auto tmp = layout_type::row_major;
429+
L == tmp ? nested_copy(m_storage.begin(), t) : nested_copy(this->template begin<tmp>(), t);
429430
}
430431

431432
/**

0 commit comments

Comments
 (0)