summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy/checks/misc-uniqueptr-reset-release.rst
blob: 2d4553e705c76fb22eaeae0da8eb9e5355831eda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.. title:: clang-tidy - misc-uniqueptr-reset-release

misc-uniqueptr-reset-release
============================


Find and replace ``unique_ptr::reset(release())`` with ``std::move()``.

Example:

.. code:: c++

  std::unique_ptr<Foo> x, y;
  x.reset(y.release()); -> x = std::move(y);

If ``y`` is already rvalue, ``std::move()`` is not added.  ``x`` and ``y`` can also
be ``std::unique_ptr<Foo>*``.
OpenPOWER on IntegriCloud