mirror of
https://github.com/CnTransGroup/EffectiveModernCppChinese.git
synced 2024-10-28 04:00:13 +08:00
Update item21.md
This commit is contained in:
parent
06abf9fa2a
commit
1108ad2b75
@ -98,7 +98,7 @@ auto spw = std::make_shared<Widget>();
|
||||
```cpp
|
||||
auto widgetDeleter = [](Widget* pw) { … };
|
||||
```
|
||||
创建一个使用它的只能指针只能直接使用`new`:
|
||||
创建一个使用它的智能指针只能直接使用`new`:
|
||||
```cpp
|
||||
std::unique_ptr<Widget, decltype(widgetDeleter)>
|
||||
upw(new Widget, widgetDeleter);
|
||||
|
Loading…
Reference in New Issue
Block a user