Skip to content

Exceptions

Hannes Hauswedell edited this page Jul 23, 2017 · 8 revisions

Exception-Safety

Safety-Guarantee

  1. none or unknown
  2. basic (invariants of the component are preserved, and no resources are leaked)
  3. strong (if an exception is thrown there are no effects)
  4. no-throw (the code will never ever throw)

Every function starts with 1., but should at least guarantee 2.

Use of exceptions in SeqAn3

  • Always guarantee at least 2.!!!
  • If you can, enforce 3.
  • move construction, move assignment and swap should always be no-throw, for all other functions heed this advice: https://blog.quasardb.net/when-noexcept-2/
Clone this wiki locally