The use of noexcept
was pretty clear to me, as the modern optimized way of marking functions with the no throw exception guarantee
struct A {
A() noexcept;
};
In item 14 of effective modern c++ I ecountered the following syntax, referred to as conditionally noexcept
template<class T, size_t N>
void swap(T (&a)[N], T (&b)[N]) noexcept(noexcept(swap(*a, *b)));
The way I get it, is that noexcept
can introduce a truth value context, but then again how can another noexcept be an argument ?
Could someone elaborate on the syntax and semantics of this use of noexcept
?
With:
template<class T, size_t N>
void swap(T (&a)[N], T (&b)[N]) noexcept(noexcept(swap(*a, *b)));
(1) (2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With