Update item21.md

This commit is contained in:
猫耳堀川雷鼓 2021-02-22 11:20:58 +08:00 committed by GitHub
parent 06abf9fa2a
commit 1108ad2b75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);