bolt/deps/llvm-18.1.8/clang-tools-extra/docs/clang-tidy/checks/performance/noexcept-swap.rst
2025-02-14 19:21:04 +01:00

13 lines
561 B
ReStructuredText

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