-
Notifications
You must be signed in to change notification settings - Fork 30
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
Modify rule S5500: mention std::ranges::move and rewrite RSPEC (CPP-5219) #3933
Merged
Merged
Changes from 12 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
49082d2
Move link to correct section
marco-antognini-sonarsource 809c831
Link to std::ranges::move
marco-antognini-sonarsource 6e045ba
Mention std::ranges::move
marco-antognini-sonarsource 090f8a5
Simplify sentence
marco-antognini-sonarsource ccfed9f
Use better function name in example
marco-antognini-sonarsource 3f9a76a
Add an example with std::ranges::move
marco-antognini-sonarsource 0acecf3
Update title
marco-antognini-sonarsource 1fedf47
Merge branch 'master' into mb/CPP-5219-S5500
marco-antognini-sonarsource 5281242
Merge branch 'master' into mb/CPP-5219-S5500
marco-antognini-sonarsource 363aad0
Merge branch 'master' into mb/CPP-5219-S5500
marco-antognini-sonarsource 0a2d8bc
Rewrite RSPEC
marco-antognini-sonarsource c8e3b67
Apply suggestions from code review
marco-antognini-sonarsource 3fca083
Keep things simpler: do not use type deduction
marco-antognini-sonarsource 1fb674b
Apply suggestions from code review
marco-antognini-sonarsource 661508c
Update rules/S5500/cfamily/rule.adoc
marco-antognini-sonarsource File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to highlight in the code snippet the root cause of the issue as generically as possible.
For example, this would be compliant:
because
std::move
is called.In a way, we don't care about the copy/move constructors.
The sentence below is meant to explain what is actually happening and justify why
std::move
is required. It also serves to connect the two examples.Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, what would you think of:
Which would be corrected as:
To me, the benefits are:
If you still disagree, I'm not going to fight. The RSPEC is correct as it is. I just feel it could be improved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your idea is not bad, but it would take me a bit of time to adapt and make other sections consistent.
It also has a downside: the diff highlighting will include the first line of the (non)compliant code because of the comment, but only the comment changes. Since the diff is on the whole line (and not on words), this will distract the readers a bit.
So I'll keep the current wording for now. We can always revisit this in the future.