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

Remove (empty) default constructor for ArrayView #5478

Merged
merged 1 commit into from Nov 28, 2017

Conversation

masterleinad
Copy link
Member

All the member variables for ArrayView are currently declared const. Hence, an empty constructed object can never point to anything useful.

@bangerth
Copy link
Member

I suspect that we don't want std::vector<ArrayView> to work, or similar. Or do we?

@davydden
Copy link
Contributor

./run-tests

@drwells
Copy link
Member

drwells commented Nov 17, 2017

I think that we should keep this so that ArrayViews are default constructible. It might be useful to put them in containers later on.

@masterleinad
Copy link
Member Author

It might be useful to put them in containers later on.

That does not require a default constructor necessarily (only if you want the objects to be default initialized).

I am not opposed to allow to modify the member variables if we decide to do so. I am just not happy that we are somewhere in between by having a constructor that always creates an object that can never be used.

@bangerth bangerth merged commit bb0867f into dealii:master Nov 28, 2017
@drwells
Copy link
Member

drwells commented Nov 29, 2017

Its been merged, but I checked and this is okay. We can do things like

  double a = 0.0;
  std::array<ArrayView<double>, 2> views2 {{{&a, 1}, {&a, 1}}};

which is, I think, the extent of what makes sense to do with this class.

@masterleinad masterleinad deleted the array_view_3 branch August 23, 2019 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants