3 ms·
noexcept is also important for optimization. If a template function is guaranteed to be exception-safe, and it’s called with a type whose move constructor isn’
by senkora 6y ago
noexcept is also important for optimization.
If a template function is guaranteed to be exception-safe, and it’s called with a type whose move constructor isn’t noexcept, then the function needs to fallback to the copy constructor to maintain exception-safety.
This happens a lot with the standard library.