vendredi 3 juillet 2020

Should I declare all members/function that doesn't throw noexcept?

One of the CppCoreGuidelines is E.12: Use noexcept when exiting a function because of a throw is impossible or unacceptable. Does it mean that I should declare noexcept on every member and functions that don't throw exceptions and doesn't call other methods/functions that throw? I know it's a good prevaricate to always declare const as much as possible, and I see a lot of const methods in different projects, but I haven't seen noexcept used that much.

Aucun commentaire:

Enregistrer un commentaire