Quick Q: When should I use noexcept? -- StackOverflow

As C++11-compliant compilers start to roll out and be adopted, people want to know to best use new C++11 features, such as:

When Should I Really Use noexcept?

 

  1. There are many examples of functions that I know will never throw, but for which the compiler cannot determine so on its own. Should I append noexcept to the function declaration in all such cases? ... For which situations should I be more careful about the use of noexcept, and for which situations can I get away with the implied noexcept(false)?
  2. When can I realistically except to observe a performance improvement after using noexcept... Do modern compilers take advantage of noexcept in this way? If not, can I excect some of them to do so in the near future?

 

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.