mardi 30 mars 2021

Should I write noexcept only to constructors and move operators?

There is a quite (very) popular question about the usage of noexcept, but it's from 8 years ago, and other popular answers are just as old. Seeing some code from other people in different projects, it seems to me that noexcept didn't become a very common thing for many developers to write.

Besides move constructor and move assignment operator, the benefit of using noexcept doesn't seems clear enough to think about for every function ("should I add noexcept here or not?").

Has somebody found a good usage of this specifier, and can share their experience?

Aucun commentaire:

Enregistrer un commentaire