samedi 27 décembre 2014

On noexcept arguments

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 ?


Aucun commentaire:

Enregistrer un commentaire