Loading…
CppCon 2019 has ended
Back To Schedule
Wednesday, September 18 • 16:45 - 17:45
Type punning in modern C++

Log in to save this to your schedule, view media, leave feedback and see who's attending!

Type punning is often used in C++ for fast floating-point math, deserialising C++ objects from a sequence of bytes, and other purposes. Popular techniques involve unions, reinterpret_cast, and memcpy. C++20 provides new useful tools, such as bit_cast. And there are proposals to provide even better control over C++ object creation in the future.

This talk is a comprehensive overview of all of these techniques. We will discuss when and how they can be used safely without causing undefined behaviour, what C++ does and does not allow you to do (and why), existing holes in the C++ language, and how to fix them. In the process, we will cover important C++ concepts such as object lifetime, value representations, and aliasing rules.

Speakers
avatar for Timur Doumler

Timur Doumler

Developer Advocate, JetBrains
Timur Doumler is C++ Developer Advocate at JetBrains and an active member of the ISO C++ standard committee. As a developer, he worked many years in the audio and music technology industry and co-founded the music tech startup Cradle. Timur is passionate about building inclusive communities... Read More →


Wednesday September 18, 2019 16:45 - 17:45 MDT
Aurora A
  • Type Design