Skip to content

Commit fdb5c1a

Browse files
committed
fix (learncpp_6): update description for make_unique
1 parent 11b34de commit fdb5c1a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

content/posts/learncpp_6/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ std::vector<std::string_view> names{ "Alex", "Betty", "Caroline", "Dave","Emily"
4747
4848
`emplace_back`会显示调用构造函数,直接在堆上预留的内存构建对象,如果是是临时对象,那么要注意如果有`explicit`那么不能执行隐式转换。而`push_back`会发生一次拷贝。
4949
50+
在 `make_unique` 下,始终会产生一次拷贝,此时两者表现一致。
51+
5052
## std::array
5153
5254
`array` 大部分功能都与 `constexpr` 兼容。

0 commit comments

Comments
 (0)