| 1 |
.. title:: clang-tidy - performance-noexcept-swap |
| 2 |
|
| 3 |
performance-noexcept-swap |
| 4 |
========================= |
| 5 |
|
| 6 |
The check flags user-defined swap and iter_swap functions not marked with ``noexcept`` or |
| 7 |
marked with ``noexcept(expr)`` where ``expr`` evaluates to ``false`` |
| 8 |
(but is not a ``false`` literal itself). |
| 9 |
|
| 10 |
When a swap or iter_swap function is marked as ``noexcept``, it assures the compiler that |
| 11 |
no exceptions will be thrown during the swapping of two objects, which allows |
| 12 |
the compiler to perform certain optimizations such as omitting exception |
| 13 |
handling code. |