isocpp / isocpp/CppCoreGuidelines

R.13 is out of date with C++17

Open
#1,701 1 comment 0 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

R.13 uses the example:

// BAD: potential leak
fun(shared_ptr<Widget>(new Widget(a, b)), shared_ptr<Widget>(new Widget(c, d)));

This could leak prior to C++17, but with the change from this accepted proposal, there is no potential leak in C++17. The explanation of this rule should be updated to reflect this.

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 with the R.13 guideline text and the linked P0145R3 proposal. Check how the shared_ptr example and explanation differ before and after C++17, then update the wording to reflect the proposal accurately. Done means the guideline no longer describes the example as a potential leak in C++17 while preserving the pre-C++17 warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.