Skip to content

for_each_n doc completed (#3933)#3934

Merged
ShannonLeavitt merged 16 commits into
MicrosoftDocs:mainfrom
BrandonPacewic:main
Jun 1, 2022
Merged

for_each_n doc completed (#3933)#3934
ShannonLeavitt merged 16 commits into
MicrosoftDocs:mainfrom
BrandonPacewic:main

Conversation

@BrandonPacewic

Copy link
Copy Markdown
Contributor

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

@PRMerger8

Copy link
Copy Markdown
Contributor

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

@PRMerger4

Copy link
Copy Markdown
Contributor

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

@PRMerger4

Copy link
Copy Markdown
Contributor

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

@PRMerger7

Copy link
Copy Markdown
Contributor

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

@PRMerger10

Copy link
Copy Markdown
Contributor

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

@jborsecnik

Copy link
Copy Markdown
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
// 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
Copy Markdown
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.

Comment thread docs/standard-library/algorithm-functions.md Outdated
Comment thread docs/standard-library/algorithm-functions.md
Comment thread docs/standard-library/algorithm-functions.md Outdated
Comment thread docs/standard-library/algorithm-functions.md Outdated

@TylerMSFT TylerMSFT left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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'

@strega-nil strega-nil left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

Comment thread docs/standard-library/algorithm-functions.md Outdated
Comment thread docs/standard-library/algorithm-functions.md Outdated
Comment thread docs/standard-library/algorithm-functions.md Outdated
Comment thread docs/standard-library/algorithm-functions.md
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
@PRMerger14

Copy link
Copy Markdown
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 <mazzucan@outlook.com>
@PRMerger-2

Copy link
Copy Markdown
Contributor

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

@BrandonPacewic

Copy link
Copy Markdown
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.

@TylerMSFT TylerMSFT left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Comment thread docs/standard-library/algorithm-functions.md Outdated
Comment thread docs/standard-library/algorithm-functions.md Outdated
@PRMerger20

Copy link
Copy Markdown
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

@TylerMSFT TylerMSFT left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
Contributor Author

That's my last change I promise 😺

@TylerMSFT

Copy link
Copy Markdown
Collaborator

#sign-off

@BrandonPacewic

Copy link
Copy Markdown
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! ❤️

@TylerMSFT TylerMSFT left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor Author

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

@TylerMSFT

Copy link
Copy Markdown
Collaborator

#sign-off

Comment thread docs/standard-library/algorithm-functions.md Outdated
@PRMerger5

Copy link
Copy Markdown
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
Copy Markdown

Hey @BrandonPacewic , great work!

@BrandonPacewic

Copy link
Copy Markdown
Contributor Author

Hey @BrandonPacewic , great work!

Thanks! 😺

@TylerMSFT

Copy link
Copy Markdown
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.