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

Fix Issue 18036 - Documentation of moveFront() #8393

Merged
merged 1 commit into from Feb 28, 2022

Conversation

pbackus
Copy link
Contributor

@pbackus pbackus commented Feb 25, 2022

...fails to mention different behavior depending on
hasElaborateCopyConstructor

The new wording is based on the documentation for core.lifetime.move.

@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @pbackus! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
18036 normal Documentation of moveFront() fails to mention different behavior depending on hasElaborateCopyConstructor

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#8393"

@acehreli
Copy link
Contributor

Thank you! Looks good to me but I don't think I can approve. (?)

Comment on lines 2058 to 2060
Moves the front of `r` out and returns it.

If `r.front` is a struct with a destructor or postblit defined, it is reset
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is slightly confusing as is because it uses "it" for both r.front (as it lives in the range r) and the returned/moved value.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should mention the copy constructor here instead of the postblit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should mention the copy constructor here instead of the postblit.

Yes, the documentation for core.lifetime.move is itself outdated too in that regard.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to "copy constructor" and tried to clarify the wording a bit.

...fails to mention different behavior depending on
hasElaborateCopyConstructor

The new wording is based on the documentation for core.lifetime.move.
@dlang-bot dlang-bot merged commit 41aaf8c into dlang:master Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants