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

YouTube

Rust Trait Runtime Polymorphism in C++

CppCon via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Explore how to implement Rust-style trait runtime polymorphism in C++ through this conference talk from CppCon 2025. Learn about a library that provides composable abstractions with zero-overhead while improving upon C++ virtual dispatch for better performance and reduced object code size. Discover how traits solve common problems with object-oriented inheritance by allowing you to avoid modifying existing types, eliminate fragile base classes, and decouple behaviors from inheritance hierarchies. Examine the benefits of traits including opt-in behavior, explicit type-safe dynamic dispatch, and polymorphism with value semantics. Study programming techniques such as automatic building of constexpr virtual tables that support Rust traits and may be applicable to other use cases. Understand why this library-based approach gives users freedoms that language features inherently deny, and see how C++ can incorporate and improve upon good ideas from other programming languages.

Syllabus

Rust Trait Runtime Polymorphism in C++ - Eduardo Madrid - CppCon 2025

Taught by

CppCon

Reviews

Start your review of Rust Trait Runtime Polymorphism in C++

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.