Video & On-Demand

CppCon 2017: Objects, Lifetimes, and References, oh my...--Nicole Mazzuca

Have you registered for CppCon 2018 in September? Early bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2017 for you to enjoy. Here is today’s feature:

Objects, Lifetimes, and References, oh my...

by Nicole Mazzuca

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

How does the C++ abstract machine really work at the lowest levels? Why does the committee design its rules the way they do? Gain insight into the object model of C++, from references to passing semantics to copy elision. C++ is a complicated language full of arcane rules and complicated tangents - learn how it's all tied together in this basic model of locations, objects, and values.

CppCon 2017: Runtime Polymorphism: Back to the Basics--Louis Dionne

Have you registered for CppCon 2018 in September? Early bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2017 for you to enjoy. Here is today’s feature:

Runtime Polymorphism: Back to the Basics

by Louis Dionne

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

C++ solves the problem of runtime polymorphism in a very specific way. It does so through inheritance, by having all classes that will be used polymorphically inherit from the same base class, and then using a table of function pointers (the virtual table) to perform dynamic dispatch when a method is called. Polymorphic objects are then accessed through pointers to their base class, which encourages storing objects on the heap and accessing them via pointers. This is both inconvenient and inefficient when compared to traditional value semantics. As Sean Parent said: Inheritance is the base class of evil.

It turns out that this is only one of many possible designs, each of which has different tradeoffs and characteristics. This talk will explore the design space for runtime polymorphism in C++, and in particular will introduce a policy-based approach to solving the problem. We will see how this approach enables runtime polymorphism with stack-allocated storage, heap-allocated storage, shared storage, no storage at all (reference semantics), and more. We will also see how we can get fine-grained control over the dispatch mechanism to beat the performance of classic virtual tables in some cases. The examples will be based on a real implementation in the Dyno library [1], but the principles are independent from the library.

At the end of the talk, the audience will walk out with a clear understanding of the different ways of implementing runtime polymorphism, their tradeoffs, and with guidelines on when to use one implementation or another.

CppCast Episode 155: C++ Insights with Andreas Fertig

Episode 155 of CppCast the only podcast for C++ developers by C++ developers. In this episode Rob and Jason are joined by Andreas Fertig to discuss C++ Insights, the Rapperswil ISO meeting and more.

CppCast Episode 155: C++ Insights with Andreas Fertig

by Rob Irving and Jason Turner

About the interviewee:

Andreas Fertig holds an M.S. in Computer Science from Karlsruhe University of Applied Sciences. Since 2010 he has been a software developer and architect for Philips Medical Systems focusing on embedded systems. He has a profound practical and theoretical knowledge of C++ at various operating systems.

He works freelance as a lecturer and trainer. Besides this he develops macOS applications and is the creator of cppinsights.io.

CppCon 2017: Fuzz or lose...--Kostya Serebryany

Have you registered for CppCon 2018 in September? Early bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2017 for you to enjoy. Here is today’s feature:

Fuzz or lose...

by Kostya Serebryany

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Fuzzing is a family of testing techniques in which test inputs are generated semi-randomly. The memory unsafety of C++ has made fuzzing a popular tool among security researchers. Fuzzing also helps with stability, performance, and equivalence testing; and it’s a great addition to everyone’s CI.

Our team has launched OSS-Fuzz, the Google's continuous fuzzing service for open source software, and a similar service for our internal C++ developers. Over 1000 C++ APIs are being fuzzed automatically 24/7, and thousands of bugs have been found and fixed.

Now we want to share this experience with the wider C++ community and make fuzzing a part of everyone’s toolbox, alongside unit tests. We will demonstrate how you can fuzz your C++ library with minimal effort, discuss fuzzing of highly structured inputs, and speculate on potential fuzzing-related improvements to C++.

CppCon 2017: dynamic_cast From Scratch--Arthur O'Dwyer

Have you registered for CppCon 2018 in September? Early bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2017 for you to enjoy. Here is today’s feature:

dynamic_cast From Scratch

by Arthur O'Dwyer

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

This session will introduce you to the C++ object model: the rules by which C++ class objects are translated into memory layouts. We'll quickly cover polymorphic class types and multiple and virtual inheritance. We'll discuss the anatomy of a virtual method call, the difference between `static_cast` and `reinterpret_cast`, and what's contained in a vtable besides function pointers. We'll see that the way `dynamic_cast` thinks about the class hierarchy is slightly different from the way we're used to drawing it; and that `dynamic_cast` is expensive enough that sometimes we can find cheaper ways to ask an object for its type! The climax will be a complete, bug-free, and fast implementation of C++'s built-in `dynamic_cast`, using our own hand-crafted artisanal run-time type information (RTTI).

Attendees will incidentally be exposed to several features of the modern C++ language, including type traits and the `final` qualifier.

This session will mostly be talking about the Itanium C++ ABI, which is the standard on Linux and OS X systems. Mapping these concepts to the MSVC ABI will be left as an exercise for the reader of the project's GitHub repo: https://github.com/Quuxplusone/from-s...

CopperSpice: Futures & Promises

New video on the CopperSpice YouTube Channel:

Futures and Promises

by Barbara Geller and Ansel Sermersheim

About the video:

In this video we talk about the concepts of futures, promises, and async. We explore why these concepts are useful, what the applications are, and also discuss some of the shortcomings of the current standard implementation.

Please take a look and remember to subscribe!

Dublin C++ Group: Variadic templates and fold-expressions -- Denis Sukhonin

Talk from Dublin C++ User Group 11.06.2018.

Variadic templates and fold-expressions

by Denis Sukhonin

About the session:

Abstract: It all started with a single printf causing undefined behavior due to mismatch of the format string and arguments. To solve similar problems in a type-safe manner C++ introduced variadic template parameters and fold-expressions. Denis covers the basics and shows how a type-safe printf function can be implemented.

Slides: https://goo.gl/mmzdrH

 

CppCon 2017: Going Nowhere Faster--Chandler Carruth

Have you registered for CppCon 2018 in September? Early bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2017 for you to enjoy. Here is today’s feature:

Going Nowhere Faster

by Chandler Carruth

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

You care about the performance of your C++ code. You have followed basic patterns to make your C++ code efficient. You profiled your application or server and used the appropriate algorithms to minimize how much work is done and the appropriate data structures to make it fast. You even have reliable benchmarks to cover the most critical and important parts of the system for performance. But you're profiling the benchmark and need to squeeze even more performance out of it... What next?

This talk dives into the performance and optimization concerns of the important, performance critical loops in your program. How do modern CPUs execute these loops, and what influences their performance? What can you do to make them faster? How can you leverage the C++ compiler to do this while keeping the code maintainable and clean? What optimization techniques do modern compilers make available to you? We'll cover all of this and more, with piles of code, examples, and even live demo.

While the talk will focus somewhat on x86 processors and the LLVM compiler, but everything will be broadly applicable and basic mappings for other processors and toolchains will be discussed throughout. However, be prepared for a lot of C++ code and assembly.