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

DPL: Constructors and operator= for DPC++ execution policies are not explicitly specified #271

Open
andreyfe1 opened this issue Nov 18, 2020 · 1 comment
Labels
DPL enhancement New feature or request

Comments

@andreyfe1
Copy link
Contributor

The following are not explicitly specified for DPC++ execution policies:

  • copy constructor
  • move constructor
  • copy assignment
  • move assignment

Is their behavior considered to be default?
For example. What if an implementation decide to mark operator= as deleted, will it be considered as a deviation from the Spec?

@akukanov akukanov added the DPL label Nov 19, 2020
@rarutyun
Copy link
Contributor

rarutyun commented Dec 3, 2020

From my perspective if we don't explicitly list the default members the behavior is as they are there with = default marker. The argument for that is the destructor. I believe that we didn't specify the destructor almost anywhere. But it's valid operation since we can create the objects on the stack (e.g. device_policy) and this is the desired scenario.

Even if we don't specify the layout explicitly I think we should consider prohibiting those default members as the breaking change. Consider one more example: Imagine that the class has all default members specified as = default without specifying the layout. I think user would assume that they can be called. Then, on the next version of the product the implementation has been changed and contains the reference in the layout which breaks the ability to call copy-assignment. To me it also looks like breaking change.

@akukanov akukanov added the enhancement New feature or request label Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DPL enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants