A move constructor or move assignment is not noexcept, so containers copy elements instead of moving them

tx0/cpp:move-operation-without-noexceptrecommendedwarningperformance/allocationdepth fastperformance

What it finds

std::vector and other containers move elements on reallocation only when the move constructor cannot throw; otherwise they copy, to keep their strong exception guarantee. A move operation that does not throw says so with noexcept. Defaulted and deleted operations are left alone.

From the rule's source, move_operation_without_noexcept.rs.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:move-operation-without-noexcept" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/cpp:move-operation-without-noexcept] reason="..."

tx0 explain tx0/cpp:move-operation-without-noexcept shows the same in the terminal. Found a false positive? Report it.