| 1 |
.. title:: clang-tidy - misc-uniqueptr-reset-release |
| 2 |
|
| 3 |
misc-uniqueptr-reset-release |
| 4 |
============================ |
| 5 |
|
| 6 |
Find and replace ``unique_ptr::reset(release())`` with ``std::move()``. |
| 7 |
|
| 8 |
Example: |
| 9 |
|
| 10 |
.. code-block:: c++ |
| 11 |
|
| 12 |
std::unique_ptr<Foo> x, y; |
| 13 |
x.reset(y.release()); -> x = std::move(y); |
| 14 |
|
| 15 |
If ``y`` is already rvalue, ``std::move()`` is not added. ``x`` and ``y`` can |
| 16 |
also be ``std::unique_ptr<Foo>*``. |
| 17 |
|
| 18 |
Options |
| 19 |
------- |
| 20 |
|
| 21 |
.. option:: IncludeStyle |
| 22 |
|
| 23 |
A string specifying which include-style is used, `llvm` or `google`. Default |
| 24 |
is `llvm`. |