Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
update 05-pointers.md #139
Closed
Conversation
| @@ -97,6 +97,8 @@ std::unique_ptr<int> pointer2 = pointer; // 非法 | |||
| > ``` | |||
| > | |||
| > 至于为什么没有提供,C++ 标准委员会主席 Herb Sutter 在他的[博客](https://herbsutter.com/gotw/_102/)中提到原因是因为『被他们忘记了』。 | |||
| 注:从 C++14 开始提供了 `std::make_unique`,其用法和原理与 `std::make_shared` 相同。 | |||
changkun
Nov 3, 2020
Owner
在第 86 行已经包含这段信息了:
std::unique_ptr<int> pointer = std::make_unique<int>(10); // make_unique 从 C++14 引入
似乎没有必要进行此修改。
在第 86 行已经包含这段信息了:
std::unique_ptr<int> pointer = std::make_unique<int>(10); // make_unique 从 C++14 引入
似乎没有必要进行此修改。
| @@ -96,6 +96,8 @@ std::unique_ptr<int> pointer2 = pointer; // illegal | |||
| > | |||
| > As for why it wasn't provided, Herb Sutter, chairman of the C++ Standards Committee, mentioned in his [blog](https://herbsutter.com/gotw/_102/) that it was because they were forgotten. | |||
| Note: Since C++14, `std::make_unique` is provided, and its usage and principle are the same as `std::make_shared`. | |||
changkun
Nov 3, 2020
Owner
同理
同理
| @@ -22,7 +22,7 @@ | |||
| 你可以选择以下几种阅读方式: | |||
|
|
|||
| 1. [GitHub 在线](./book/zh-cn/toc.md) | |||
| 2. [PDF 文档](https://changkun.de/modern-cpp/modern-cpp-tutorial-zh-cn.pdf) | |||
| 2. [PDF 文档](https://changkun.de/modern-cpp/pdf/modern-cpp-tutorial-zh-cn.pdf) | |||
changkun
Nov 3, 2020
Owner
似乎此修改已经在 master 分支上得到修复了
似乎此修改已经在 master 分支上得到修复了
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
resolve #issue_id
Description
Please describe the motivation of this pull request, and what problem was solved in this PR.
Change List
Reference
Please add reference if necessary
说明
此处详细说明 PR 的动机是什么、解决了什么样的问题。
变化箱单
参考文献
如果有请注明