1 .. title:: clang-tidy - readability-uniqueptr-delete-release
3 readability-uniqueptr-delete-release
4 ====================================
6 Replace ``delete <unique_ptr>.release()`` with ``<unique_ptr> = nullptr``.
7 The latter is shorter, simpler and does not require use of raw pointer APIs.
11 std::unique_ptr<int> P;
16 std::unique_ptr<int> P;
22 .. option:: PreferResetCall
24 If `true`, refactor by calling the reset member function instead of
25 assigning to ``nullptr``. Default value is `false`.
29 std::unique_ptr<int> P;
34 std::unique_ptr<int> P;