Lightning Talk: The Most Important C++ Feature - Nicolai Josuttis - ACCU 2023
Vložit
- čas přidán 14. 09. 2023
- ACCU Membership: tinyurl.com/ydnfkcyn
accu.org
www.accuconference.org/
Lightning Talk: The Most Important C++ Feature - Nicolai Josuttis - ACCU 2023
Slides: accu.org/conf-previous/accu2023/
A talk on the value of destructors and the RAII pattern.
---
Nicolai Josuttis
Nicolai M. Josuttis (www.josuttis.com) is well known in the programming community for his authoritative books and talks. For more than 20 years he is a member of the C++ Standard Committee. He is the (co-)author of several worldwide best-sellers, including
"C++20 - The Complete Guide",
"C++17 - The Complete Guide",
"C++ Move Semantics",
"C++ Templates" (with David Vandevoorde and Doug Gregor), and
"The C++ Standard Library".
---
CZcams Videos Filmed, Edited & Optimised by Digital Medium: events.digital-medium.co.uk
#accuconf #programming #destructor - Věda a technologie
I agree that C could benefit from some form of *explicit* and *optional* RAII, there is even a proposal to add "defer" statement to address this issue.
I fully agree with Nicolai.
When I had to do some coding in C# (when it was just new) deterministic destruction/cleanup/closing of a resource was *the major* thing I was missing. Having to go back to resorting to C idioms was just painful.
Thumbnail spoiled it, but I agree 100%
I agree 100% :)
when templates and constexpr showed up I was like YAY these are the ones, turns out its a destructor.
RAII was already in C, though.
#define RAII(declvar, destruct) for (declvar, ***_i, **_ip = &_i; _ip; _ip = 0, destruct)
RAII (FILE* f = fopen(name, "r"), fclose(f))
{
if (!f) return ERROR;
...
if (done) continue;
...
} // end of f's lifetime
Taboo: everyone secretly hates move semantics.