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

ViewPlainPtr doesn't work as promised #655

Closed
krzikalla opened this issue Sep 25, 2018 · 2 comments · Fixed by #2105
Closed

ViewPlainPtr doesn't work as promised #655

krzikalla opened this issue Sep 25, 2018 · 2 comments · Fixed by #2105

Comments

@krzikalla
Copy link

ViewPlainPtr has a

auto operator=(ViewPlainPtr &&) -> ViewPlainPtr & = default;

However, since there are some const members in ViewPlainPtr , this operator will never work.
Also, why is

auto operator=(ViewPlainPtr const &) -> ViewPlainPtr & = delete;

Compared with the other line I don't see a reason for the deletion here.

@BenjaminW3
Copy link
Member

BenjaminW3 commented Oct 10, 2018

Let's first think about the constructors.

  • copy constructor: ViewPlainPtr(ViewPlainPtr const &) = delete is wrong. You should be able to create a copy of the View. I will fix this.
  • move constructor: There is nothing to move in this class, the members are all simple types which have to be copied anyway. If we want to keep the const members, we could fix this constructor by implementing it by hand doing copies on the members.

I am still undecided about the assignment operators. I clearly see the benefit of const members but I also see why you would want to assign the views.

@BenjaminW3
Copy link
Member

Both constructors (copy and move) now work as expected. As written above I will have a look at the assignment.

@BenjaminW3 BenjaminW3 removed this from the Version 0.4.0 milestone Apr 19, 2019
bernhardmgruber added a commit to bernhardmgruber/alpaka that referenced this issue Aug 29, 2023
bernhardmgruber added a commit to bernhardmgruber/alpaka that referenced this issue Aug 29, 2023
j-stephan pushed a commit that referenced this issue Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants