C++ Logo

std-proposals

Advanced search

[std-proposals] auto-noexcept for move and lambdas

From: Nikl Kelbon <kelbonage_at_[hidden]>
Date: Mon, 9 Jun 2025 18:33:15 +0400
It would be nice to add automatic noexpect detection, if it is not
explicitly set, for the move constructor, move assign operator and for
lambdas
Use cases: move constructor not marked as noexcept is performance bug

Typical scope exit implementations checks noexcept function or not in
destructor, it may force them to make useless actions or make scope_exit
not std::destructible (throw constructor)

How ?

Just check every expression in lambda / move constructor / move assign if
it may throw by current C++ rules and noexcept == 9noexcpt(exprs) || ...)

Received on 2025-06-09 14:33:27