June 24, 2025Jun 24 Registration is now open for CppCon 2025! The conference starts on September 15 and will be held in person in Aurora, CO. To whet your appetite for this yearâs conference, weâre posting videos of some of the top-rated talks from last year's conference. Hereâs another CppCon talk video we hope you will enjoy â and why not register today for CppCon 2025! Modern C++ Error Handling by Phil Nash Summary of the talk: Weâve had exceptions in C++ since before the first standard. C++17 introduced std::optional and C++23 std::expected (along with the so-called Monadic Operations for both types). What should we use and when? Meanwhile we still have older approaches, such as boolean or error code returns, as well as global or thread local error status or pointer or reference arguments. Do these still have a place? And where does assert fit in? And the (hopefully) upcoming contracts? Perhaps more importantly, once weâve examined all the trade-offs, can we defer any of those decisions to when we are best positioned to commit to them? Erroneous conditions can have a big impact on your codeâs safety and security, so error handling shouldnât just be left to the âexercise left for the readerâ in the books we used to read. Letâs get this all straight. View the full article
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.