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

Assignment from initializer lists in xsemantics #218

Open
SylvainCorlay opened this issue Mar 26, 2017 · 4 comments
Open

Assignment from initializer lists in xsemantics #218

SylvainCorlay opened this issue Mar 26, 2017 · 4 comments

Comments

@SylvainCorlay
Copy link
Member

Since we have nested initializer list constructors for containers, having an overloaded assignment operator with the same nested initializer list would probably make sense.

@JohanMabille
Copy link
Member

JohanMabille commented Mar 26, 2017

I agree with having such an operator. However, this operator should be in xcontainer. Assignment operators in xsemantics should be mathematical assignments only.

@SylvainCorlay
Copy link
Member Author

Woudn't it prevent to assign an initializer list to an xview?

@JohanMabille
Copy link
Member

xview can provide this operator too.

After more thoughts on that, which interface should provide the assignment from initializer lists depends on whether we want to provide computed assignment from initializer list. If so, we can consider initializer lists as a specific shortcut for xexpression, and all assignment operators should be provided by the semantic classes. Otherwise, there should be a simple assignment operator in container and view classes.

@wolfv
Copy link
Member

wolfv commented Apr 26, 2018

I have just added a initializer from a C array to xtensor fixed -- therefore I am not sure how that would play with an initializer_list assign in the semantics.

However, it would still be cool to be able to use initializer_list with xview.

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

No branches or pull requests

3 participants