Skip to content

fix(c++): Add a section title comment for grouping defaulted/deleted copy/move constructors & assignment operators. - #75

Open
davidlion wants to merge 8 commits into
y-scope:mainfrom
davidlion:category-fix
Open

fix(c++): Add a section title comment for grouping defaulted/deleted copy/move constructors & assignment operators.#75
davidlion wants to merge 8 commits into
y-scope:mainfrom
davidlion:category-fix

Conversation

@davidlion

@davidlion davidlion commented Aug 4, 2026

Copy link
Copy Markdown
Member

Description

This grouping case was in Notion, but was missed when adding 7add077.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

CI passes. This grouping is already applied in some CLP classes.

Summary by CodeRabbit

  • Documentation
    • Added C++ contribution guidance for organizing defaulted or deleted copy/move operations.
    • Included rule-of-five examples and guidance on the rule of zero.
    • Added links to relevant C++ Core Guidelines and a related static-analysis check.

@davidlion
davidlion requested a review from a team as a code owner August 4, 2026 00:57
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@davidlion, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4cea5309-4611-4fa1-9d82-94522d0ca2f8

📥 Commits

Reviewing files that changed from the base of the PR and between aa904d0 and 37d3e2d.

📒 Files selected for processing (1)
  • docs/dev-docs/dev-guide/contrib-guides-cpp.md

Walkthrough

The 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.

Changes

C++ contribution guide

Layer / File(s) Summary
Special member declaration guidance
docs/dev-docs/dev-guide/contrib-guides-cpp.md
Documents declaration grouping between the Constructors and Operators sections. Adds rule-of-five and rule-of-zero guidance, an example, and references for the related lint check and Core Guidelines.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: kirkrodrigues

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: documenting a section title comment for grouping defaulted or deleted copy/move operations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3f510fb and 598fdfa.

📒 Files selected for processing (1)
  • docs/dev-docs/dev-guide/contrib-guides-cpp.md

Comment thread docs/dev-docs/dev-guide/contrib-guides-cpp.md Outdated
Comment thread docs/dev-docs/dev-guide/contrib-guides-cpp.md Outdated

@kirkrodrigues kirkrodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread docs/dev-docs/dev-guide/contrib-guides-cpp.md Outdated
Comment thread docs/dev-docs/dev-guide/contrib-guides-cpp.md Outdated
Comment thread docs/dev-docs/dev-guide/contrib-guides-cpp.md Outdated
Comment thread docs/dev-docs/dev-guide/contrib-guides-cpp.md Outdated
Comment thread docs/dev-docs/dev-guide/contrib-guides-cpp.md Outdated
Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com>
@davidlion davidlion changed the title fix(c++): Add a section title comment for grouping constructor and operator functions in a class declaration. fix(c++): Add a section title comment for grouping defaulted/deleted copy/move constructors & assignment operators. Aug 5, 2026
@davidlion
davidlion requested a review from kirkrodrigues August 5, 2026 05:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 60a71de and aa904d0.

📒 Files selected for processing (1)
  • docs/dev-docs/dev-guide/contrib-guides-cpp.md

Comment thread docs/dev-docs/dev-guide/contrib-guides-cpp.md Outdated
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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
##### 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// Default move constructor and assignment operator.
// Default move constructor and assignment operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants