These are two kinds of usage of noexcept
.
The noexcept operator used in noexcept(x.swap(y))
would return true
if x.swap(y)
is declared not to throw, and false
otherwise.
It can be used within a function template's noexcept specifier to declare that the function will throw exceptions for some types but not others.
The noexcept specifier is used to specify whether a function could throw exceptions. noexcept(noexcept(x.swap(y)))
specifies swap
throws or not according to the result of noexcept(x.swap(y))
; i.e. whether swap
could throw or not depends on whether x.swap(y)
could throw or not.