~/talk

Exception-Safe Code, Part III

Talkat CppCon 2014 · on Tuesday, 2014-09-09· at 16:45· Descartes· [rust]
name:Jon Kalb
github:boostcon
slides:none on file

Clearly stated, actionable guidelines for C++11/14 exception safety: make_shared/make_unique and smart pointers for ownership, non‑throwing swap (or noexcept moves) plus the swap‑and‑copy idiom, RAII reframed as responsibility acquisition, draw a critical line to get the strong guarantee, and prefer throw‑by‑value/catch‑by‑reference and noexcept destructors. Includes implementation toys: scope guards, exception→error translators (lipandcot), Boost.Exception patterns, and a wrapper/refactor path for legacy code — Adobe‑scale multi‑million‑line migrations succeed with this incremental approach. Materials and code live on the GitHub link.

AI-written summary · about

  1. 0:00Start
  2. 0:25RAII Examples
  3. 1:35What happens to the object if acquisition fails?
  4. 3:00Every Resource in a Object
  5. 4:03Smart Pointer "Gotcha"
  6. 9:47Lesson Learned
  7. 13:40Cleanup Code
  8. 17:30Fundamental Object Functions . Construction
  9. 22:47Swapperator Examples struct Begin
  10. 23:39Swapperator Examples template struct Circular Buffer
  11. 27:53Calling swap in a template (alternative)
  12. 30:19The Critical Line
  13. 32:44struct Resource Owner
  14. 34:12swap()
  15. 36:59Strategy
  16. 38:50Most Important Design Guideline
  17. 41:14Exception-Safety Guidelines
  18. 42:36Implementation Techniques
  19. 49:07boost::exception
  20. 50:16Legacy Code
  21. 52:11Sean's Rules 1.All new code is written to be exception safe
  22. 53:37Refactoring Steps
  23. 54:51Example Code
  24. 57:04Example Rewrite
  25. 59:29What does Exception- Safe Code look like?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.