-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
making adapt(std::array) return xfixed_adaptor. #2350
base: master
Are you sure you want to change the base?
making adapt(std::array) return xfixed_adaptor. #2350
Conversation
029a894
to
299be1d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -209,7 +209,8 @@ namespace xt | |||
* @param container the container to adapt | |||
* @param l the layout_type of the xtensor_adaptor | |||
*/ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, but I didn't really want to change existing implementation, as I'm not too deep into it)
@@ -400,7 +400,7 @@ namespace xt | |||
struct xcontainer_inner_types<xfixed_adaptor<EC, S, L, SH, Tag>> | |||
{ | |||
using storage_type = std::remove_reference_t<EC>; | |||
using reference = typename storage_type::reference; | |||
using reference = inner_reference_t<storage_type>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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_adaptor
instead ofxtensor_adaptor
.