making adapt(std::array) return xfixed_adaptor.#2350
making adapt(std::array) return xfixed_adaptor.#2350vakokako wants to merge 2 commits intoxtensor-stack:masterfrom
Conversation
029a894 to
299be1d
Compare
JohanMabille
left a comment
There was a problem hiding this comment.
Thanks for implementing this! I think it is acceptable to provide this implementation on Linux / OSX only, and keep the previous one on Windows. We have a long story of ICEs with MSVC compilers, and we dropped support for fixed container on Windows.
| template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C> | ||
| template <layout_type L = XTENSOR_DEFAULT_LAYOUT, class C, | ||
| XTL_REQUIRES(detail::not_an_array<std::decay_t<C>>)> | ||
| inline xtensor_adaptor<C, 1, L> |
There was a problem hiding this comment.
I think the return type should be xtensor_adaptor<xtl::closure_type_t<C>, 1, L>, according to the implementation below.
There was a problem hiding this comment.
yep, but I didn't really want to change existing implementation, as I'm not too deep into it)
| { | ||
| using storage_type = std::remove_reference_t<EC>; | ||
| using reference = typename storage_type::reference; | ||
| using reference = inner_reference_t<storage_type>; |
interesting, what makes the msvc fail? |
That's an Internal Compiler Error, so it is hard to say. But I would bet on an out of memory error due to too many template instantiations. |
68c803b to
4929a96
Compare
4929a96 to
dc1378f
Compare
Hi Johan! Just to clarify, do you mean this PR should be changed to provide the previous implementation on Windows, or can it be merged as is? Thanks for your help! |
|
Hi Mario! I think it should be changed to keep the previous implementation on Windows to avoid ICE and weird failures due to compiler bugs. |
Good, I'll ping Mykola about this and we'll see to update the PR. |
This implements #2337.
Making
adapt(std::array)returnxfixed_adaptorinstead ofxtensor_adaptor.