tidy - performance-noexcept-swap — Extra Clang Tools 22.0.0git documentation (original) (raw)

performance-noexcept-swap

The check flags user-defined swap and iter_swap functions not marked withnoexcept or marked with noexcept(expr) where expr evaluates tofalse (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.