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

docs: add ranged based for loop concept files #945

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

vaeng
Copy link
Contributor

@vaeng vaeng commented Feb 25, 2025

No description provided.

@vaeng vaeng added the x:type/docs Work on Documentation label Feb 25, 2025
@vendethiel
Copy link

This might deserve a part on using it with auto as well, which is very often used and sometimes less error-prone, like if you forget the const on the key type when traversing a map and it has to copy the element.

@vaeng
Copy link
Contributor Author

vaeng commented Feb 26, 2025

This might deserve a part on using it with auto as well, which is very often used and sometimes less error-prone, like if you forget the const on the key type when traversing a map and it has to copy the element.

Do you think we should change the current state further?

The auto keyword comes a bit later in the syllabus, together with smart pointers. Maybe I should move them?

@vendethiel
Copy link

Good point, I'm not sure. Maybe it should be introduced later, when they might actually mess it up :-)

- `container`: The array or vector to loop over.

## Example Usage

Copy link
Member

Choose a reason for hiding this comment

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

This took me a minute to work out but I like it! :)

Maybe it would be worth saying...

Suggested change
In this code, we loop over each word, retrieving the first letter each time, to reveal the obscured password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x:type/docs Work on Documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants