fix(c++): Add a section title comment for grouping defaulted/deleted copy/move constructors & assignment operators. - #75
Conversation
|
Warning Review limit reached
Next review available in: 48 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe C++ contribution guide adds rules for grouping defaulted or deleted copy/move constructors and assignment operators. It also adds rule-of-five and rule-of-zero guidance, an example, and related references. ChangesC++ contribution guide
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/dev-docs/dev-guide/contrib-guides-cpp.md`:
- Around line 177-178: Update the rule-of-zero-and-five statement near the
Clang-tidy guidance to either name the exact enabled clang-tidy check and
relevant project configuration, or soften the wording to state only that
clang-tidy can check related guidance. Do not present this as universal
clang-tidy behavior without identifying the configured check.
- Around line 162-171: Revise the Rule of Five guidance in “Grouping defaulting
or deleting of constructors and operators” to distinguish C++ language
suppression of implicit move operations from the guideline’s recommended review
of the copy constructor, copy assignment operator, move constructor, move
assignment operator, and destructor. Correct the grammar to “This commonly
occurs,” use “constructors and assignment operators,” and remove the claim that
defining a destructor requires all other declarations to be defined or deleted.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 295edf29-a240-406a-b1f4-8a286b5717dd
📒 Files selected for processing (1)
docs/dev-docs/dev-guide/contrib-guides-cpp.md
kirkrodrigues
left a comment
There was a problem hiding this comment.
Can't comment on line 148 and 149 but can we add this bullet below both of them?
* [Except](#defined-deleted-copy-move-constructors-and-assignment-operators) when
defaulting/deleting both a copy/move constructor *and* assignment operator.
For the PR title, how about:
fix(c++): Add a section title comment for grouping defaulted/deleted copy/move constructors & assignment operators.
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/dev-docs/dev-guide/contrib-guides-cpp.md`:
- Around line 149-153: Update both “See the exception below” links in the
Operators documentation section to target the fragment generated by the
“Defaulted/deleted copy/move constructors and assignment operators” heading, or
add an explicit anchor matching the existing fragment; ensure both links resolve
correctly.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 8907efd3-5448-46dc-98ea-68be2b7827d0
📒 Files selected for processing (1)
docs/dev-docs/dev-guide/contrib-guides-cpp.md
| Note, `<InheritedClass>` is a placeholder that should be replaced with the name of the class that | ||
| first declares the virtual method. | ||
|
|
||
| ##### Defaulted/deleted copy/move constructors and assignment operators |
There was a problem hiding this comment.
| ##### Defaulted/deleted copy/move constructors and assignment operators | |
| (defaulteddeleted-copymove-constructors-and-assignment-operators)= | |
| ##### Defaulted/deleted copy/move constructors and assignment operators |
Necessary in order to get Sphinx to link to the heading correctly.
| // Constructors | ||
| Foo() { ... }; | ||
|
|
||
| // Default copy constructor and assignment operator. |
There was a problem hiding this comment.
| // Default copy constructor and assignment operator. | |
| // Default copy constructor and assignment operator |
| Foo(const Foo&) = default; | ||
| Foo& operator=(const Foo&) = default; | ||
|
|
||
| // Default move constructor and assignment operator. |
There was a problem hiding this comment.
| // Default move constructor and assignment operator. | |
| // Default move constructor and assignment operator |
Description
This grouping case was in Notion, but was missed when adding 7add077.
Checklist
breaking change.
Validation performed
CI passes. This grouping is already applied in some CLP classes.
Summary by CodeRabbit