Skip to content

for_each_n doc completed (#3933) #3934

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

Merged
merged 16 commits into from
Jun 1, 2022

Conversation

BrandonPacewic
Copy link
Contributor

This pr fixes #3933. Adding documentation for the STL algorithm for_each_n.

@PRMerger8
Copy link
Contributor

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@PRMerger4
Copy link
Contributor

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@PRMerger4
Copy link
Contributor

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@PRMerger7
Copy link
Contributor

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@PRMerger10
Copy link
Contributor

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@jborsecnik
Copy link
Contributor

@TylerMSFT,

Can you review the proposed changes?

IMPORTANT: When the changes are ready for publication, add a #sign-off comment to signal that the PR is ready for the review team to merge. Thanks.

#label:"aq-pr-triaged"

@PRMerger15 PRMerger15 added the aq-pr-triaged Tracking label for the PR review team label May 30, 2022
@@ -2191,7 +2191,7 @@ int main()

// The function object is templatized and so can be
// used again on the elements with a different Factor
for_each (v1.begin( ), v1.end( ), MultValue<int> (5 ) );
for_each ( v1.begin( ), v1.end( ), MultValue<int> ( 5 ) );
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi, our style is to not have the extra spacing between parens.

Copy link
Collaborator

@TylerMSFT TylerMSFT left a comment

Choose a reason for hiding this comment

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

@BrandonPacewic, thank you so much for seeing this hole and patching it up! Really appreciate you improving the docs.
I left some minor comments for you to consider.

An input iterator addressing the position of the first element in the range to be operated on.

*`count`*\
A signed or unsigned integral type specifying the number of elements to be operated on.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The detail is correct but it may be more consumable to simply say 'The number of elements to operate on'

Copy link
Contributor

@strega-nil strega-nil left a comment

Choose a reason for hiding this comment

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

(accidentally reviewing from my personal account sorry lol)

Comment on lines +2259 to +2260
An iterator to the element that follows the last element processed if *`count`* > zero,
otherwise the first element.
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 unnecessarily confusing, imo; I would say something more like:

Suggested change
An iterator to the element that follows the last element processed if *`count`* > zero,
otherwise the first element.
The iterator after the last element processed.

Co-authored-by: nicole mazzuca <[email protected]>
@PRMerger14
Copy link
Contributor

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@PRMerger14 PRMerger14 requested a review from TylerMSFT May 31, 2022 19:11
Co-authored-by: nicole mazzuca <[email protected]>
@PRMerger-2
Copy link
Contributor

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@BrandonPacewic
Copy link
Contributor Author

Example looks better now unless anyone has a problem with how I wrote the print_vector function, perhaps it should only expect a vector<int> instead of a templated vector? I avoided the auto keyword but it might make it easier to understand.

The wording I used for the params is almost identical to the fill_n function. Should it be changed to make it easier to read? It is possible that I am making a mistake by trying to use the older documentation as a guide.

Copy link
Collaborator

@TylerMSFT TylerMSFT left a comment

Choose a reason for hiding this comment

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

Hi Brandon,
Thank you for hanging in there on this. Thank you for the updates so far. I agree with the comment Stephan made about the lambdas. I'll watch for the update addressing that, and then we'll see if we can get this through.

Oh, regarding using the older documentation as a guide, yes, things have evolved. The difficulty is that we have hundreds of topics that are older than some of the people who come here to use them. We'd like to update them all, but simply don't have the resources. So, we go through what you are going through now, which is trying to make a little corner of the C++ docs better than it was before :-)

@PRMerger12
Copy link
Contributor

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@PRMerger12 PRMerger12 requested a review from TylerMSFT May 31, 2022 22:34
@PRMerger20
Copy link
Contributor

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@PRMerger20 PRMerger20 requested a review from TylerMSFT May 31, 2022 22:58
Copy link
Collaborator

@TylerMSFT TylerMSFT left a comment

Choose a reason for hiding this comment

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

@BrandonPacewic, thank you for making this contribution to the docs. I realize that you are doing it out of good will and on your own time. Thank you for improving this doc and participating in going back and forth with us on it.

@PRMerger15
Copy link
Contributor

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@PRMerger15 PRMerger15 requested a review from TylerMSFT May 31, 2022 23:09
@BrandonPacewic
Copy link
Contributor Author

That's my last change I promise 😺

@TylerMSFT
Copy link
Collaborator

#sign-off

@BrandonPacewic
Copy link
Contributor Author

@BrandonPacewic : Thanks for your contribution! The author(s) have been notified to review your proposed change.

I love working on these types of things. It is no burden for me to write back and forth. I sincerely appreciate everyone's willingness to work with me! ❤️

Copy link
Collaborator

@TylerMSFT TylerMSFT left a comment

Choose a reason for hiding this comment

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

Re-approving - getting a request to do so for some reason.

@BrandonPacewic
Copy link
Contributor Author

I made one more commit a few seconds after you approved the changes

@TylerMSFT
Copy link
Collaborator

#sign-off

@PRMerger5
Copy link
Contributor

@ShannonLeavitt : Thanks for your contribution! The author(s) have been notified to review your proposed change.

@PRMerger5 PRMerger5 requested a review from TylerMSFT June 1, 2022 15:21
@ShannonLeavitt ShannonLeavitt merged commit 7a731cc into MicrosoftDocs:main Jun 1, 2022
@wadepickett
Copy link

Hey @BrandonPacewic , great work!

@BrandonPacewic
Copy link
Contributor Author

Hey @BrandonPacewic , great work!

Thanks! 😺

@TylerMSFT
Copy link
Collaborator

@BrandonPacewic , I sent you an e-mail a few minutes ago. Check your junk mail because it'll probably go there :-)

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.

Section for STL algorithm function for_each_n not completed.