Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Variations on Variants

CppNow via YouTube

Overview

Explore the intricacies of std::variant in C++ through this comprehensive conference talk from CppNow 2021. Delve into the rationale behind std::variant as a type-safe alternative to C's union, examining typical usage patterns and implementation details. Gain insights into memory layout and runtime performance implications. Investigate key differences between std::variant and union, focusing on serialization use cases where unions excel but std::variant falls short. Discover innovative approaches to address these limitations, including Intrusive-Variant and Variant-of-Base techniques. Examine the C++ standard's stance on unions and their potential pitfalls. Learn about counterintuitive applications of std::variant, such as a simple mechanism for de-virtualization. Equip yourself with the knowledge to modernize existing low-level C-style code and deepen your understanding of variant internals in this 1 hour 31 minute presentation by experienced software developer and architect Roi Barkan.

Syllabus

Variations on variants - Roi Barkan - [CppNow 2021]

Taught by

CppNow

Reviews

Start your review of Variations on Variants

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.