Constructors and destructors: A few things you might want to know - Pavel Novikov - CPPP 2021

Опубликовано: 14 Май 2026
на канале: CPPP Conference
189
3

https://github.com/CpppFr/CPPP-21
https://cppp.fr/
---
It seems that in C++ there is nothing easier than constructor and destructor. But some interesting things can make your life better if you keep them in mind when you write code.

In this talk we will discuss some of the tricks and pitfalls in coding, as well as broader topics, such as type design.

For example, what's the difference between a privately declared and a deleted constructor? (Spoiler: none.)

We will also discuss:

0/3/5 rules;
constexpr constructors;
explicit constructors and strong typing;
copy/move and equivalence;
destructors are now noexcept by default (and when destructors can still throw exceptions);
virtual destructors and polymorphism;
and few other things.

---
Pavel Novikov
Align Technology

Got an engineering degree in missilery from BMSTU.

Loves C++ and knows how to cook it.

Likes metaprogramming, multithreading and asynchronous programming, coroutine adoption enthusiast.

---
Streamed & Edited by Digital Medium Ltd - events.digital-medium.co.uk
Enquiries: [email protected]

Graphic design: Oscar Larousse

Logo music: Agnès Vincent http://agnesvincent.com/