isocpp / isocpp/CppCoreGuidelines

Mention and enforce const unique_ptr pattern

Open
#1,102 7 comments 1 reaction 1 assignee View on GitHub

@NN--- is already working on this.

Since Feb 12, 2018.

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

Description

C++ Core Guidelines suggest to use either unique_ptr or shared_ptr for better code.
It should also mention const unique_ptr pattern for scoped based pointers

void f()
{
 // non-copyable, non-movable and non-resettable object
 auto const o = make_unique<Object>();
}

EDITED: Use make_unique

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.