CppCon 2019: Timur Doumler “Type punning in modern C++”
—
Discussion & Comments:
—
Presentation Slides, PDFs, Source Code and other presenter materials are available at:
—
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.
—
Timur Doumler
Timur Doumler is a C developer
1 view
90
22
2 years ago 01:29:55 1
Sorting Algorithms: Speed Is Found In The Minds of People - Andrei Alexandrescu - CppCon 2019
2 years ago 00:53:49 1
Back to Basics: Move Semantics (part 2 of 2) - Klaus Iglberger - CppCon 2019
3 years ago 01:01:30 1
CppCon 2019: Ben Saks “Back to Basics: Exception Handling and Exception Safety”
3 years ago 00:51:12 1
CppCon 2019: Kostas Kyrimis ADL: introduction in name taxonomy, customization points and use cases
3 years ago 01:00:19 1
CppCon 2019: Timur Doumler “Type punning in modern C++”
3 years ago 00:52:23 5
CppCon 2019: Miro Knejp “Non-conforming C++: the Secrets the Committee Is Hiding From You”
4 years ago 00:59:53 1
CppCon 2019: Chandler Carruth “There Are No Zero-cost Abstractions”
4 years ago 00:55:42 3
CppCon 2019: Matt Godbolt “Path Tracing Three Ways: A Study of C++ Style”
4 years ago 01:00:15 1
C++20 STL Features: One Year of Development on GitHub - Stephan T. Lavavej - CppCon 2020
4 years ago 01:03:05 1
CppCon 2019: Timur Doumler “C++20: The small things”
4 years ago 01:31:26 1
CppCon 2019: Bjarne Stroustrup “C++20: C++ at 40”
5 years ago 00:56:45 1
CppCon 2019: Greg Law “Modern Linux C++ debugging tools - under the covers”
5 years ago 01:00:15 1
CppCon 2019: Patrice Roy “C++ as a First Language... Really?”
5 years ago 00:32:20 1
CppCon 2019: Billy O’Neal “C++ Standard Library “Little Things”
5 years ago 00:58:02 1
CppCon 2019: Jonathan Müller “Using C++20’s Three-way Comparison <=>”
5 years ago 01:05:31 1
CppCon 2019: Gordon Brown “Efficient GPU Programming with Modern C++”
5 years ago 00:13:26 1
C++ Weekly - Ep 173 - The Important Parts of C++98 in 13 Minutes