Skip to content
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

xio with view + newaxis never compiles #129

Closed
wolfv opened this issue Feb 9, 2017 · 2 comments · Fixed by #133
Closed

xio with view + newaxis never compiles #129

wolfv opened this issue Feb 9, 2017 · 2 comments · Fixed by #133
Labels

Comments

@wolfv
Copy link
Member

wolfv commented Feb 9, 2017

This snippet never finishes compiling for me (no error, just takes forever):

	xt::xarray<double> d1 = xt::random::rand<double>({5});
	auto d12 = view(d1, newaxis(), all());
	std::cout << d12 << std::endl;

However, this compiles fine:

	xt::xarray<double> d1 = xt::random::rand<double>({5});
	auto d12 = view(d1, newaxis(), all());
	xt::xarray<double> a = d12;
	std::cout << a << std::endl;
@wolfv
Copy link
Member Author

wolfv commented Feb 9, 2017

Ok, I investigated this a bit more, and the bug is somewhere in either integral_count<S...>() or newaxis_count<S...>() in the const oeprator() accessor in xview. But I am still not sure why it's infinitely recursing (or whatever is exactly happening).

It's happening when using the accessor with empty Args...

@wolfv
Copy link
Member Author

wolfv commented Feb 9, 2017

ahhhhhhhhhhhhhhhhhhhhh

std::make_index_sequence<sizeof...(Args)
                                                    + integral_count<S...>()
                                                    - newaxis_count<S...>()

is overflowing if sizeof...(Args) == 0 and newaxis_count<S...>() == 1...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants