~/lightning

Lightning talk: Manual (de)initialization A Rust and C++

Lightningat Rustikon 2026 Β· 2026-03-19..03-20Β· [c-and-cpp, rust]
links:none on file
slides:none on file

Compares concrete recipes for manual initialization and destruction: Rust uses std::mem::MaybeUninit plus raw pointers and unsafe writes to do in-place init; C++ uses placement new into an aligned byte buffer. Destruction order differs: Rust runs drops in declaration order (and field layout is unspecified) while C++ initializes in declaration order and drops in reverse. To control drop order Rust uses ManuallyDrop and explicit drop_in_place calls; C++ uses the union trick to avoid implicit destructors.

AI-written summary Β· about

  1. 0:00Introduction
  2. 0:48Automatic memory init in Rust/C++
  3. 2:14Manual init in Rust
  4. 4:24Manual init in C++
  5. 5:48Automatic destructor behavior
  6. 6:50Destructor order differences
  7. 7:51Controlling drop order
  8. 10:16Summary
~/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.