isocpp / isocpp/CppCoreGuidelines

"Note that using a reference member is almost always wrong" ?

Open
#1,707 10 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
45.3k
Forks
5.6k
PR merge metrics
No merged PRs in 30d

Description

The text "Note that using a reference member is almost always wrong" appears in the exception text for http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#define-copy-move-and-destroy-consistently in appendix C. As far as I can see there is no other treatment of this issue anywhere in the core guidelines. To me this seems like quite a strong (and in my opinion wrong) statement with no justification offered. If it is indeed the opinion put forth by the core guidelines that this is the case then I think it deserves its own rule. If not then I think that comment should be removed or revised.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CppCoreGuidelines appendix C section anchored by #define-copy-move-and-destroy-consistently and review the exception text about reference members. Read the issue discussion to determine whether the statement should be justified, revised, removed, or made into a separate rule; done means the guidance has a settled, documented resolution.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.