Without any argument

The use noexceptwas quite clear for me, since the modern optimized way of marking functions with a guarantee without exception

struct A {
    A() noexcept; 
}; 

In paragraph 14 of <power> effective modern C ++ I ecountered the following syntax, called conditionallynoexcept

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 it noexceptcan introduce the context of truth of truth , but then again, what can the noexcept argument be ?

Can someone clarify the syntax and semantics of this use noexcept?

+4
source share
2 answers

WITH

template<class T, size_t N>
void swap(T (&a)[N], T (&b)[N]) noexcept(noexcept(swap(*a, *b)));
                                  (1)      (2)
+9

noexcept :

, ,

noexcept    ( noexcept(swap(*a, *b)))
^^^^^^^^      ^^^^^^^^
specifier     operator
+5

Source: https://habr.com/ru/post/1569113/


All Articles