Войти
  • 114544Просмотров
  • 2 года назадОпубликованоLogan Smith

Two Ways To Do Dynamic Dispatch

Rust and C++ both have built-in (but different-flavored) support for dynamic dispatch, and both also let you open the hood and implement it the other way that's not built-in. In this one we look at both languages' approaches, weigh the pros and cons, and ultimately come away seeing that they're both the right choice in different situations (isn't that just so unsatisfying and typical). Special guest appearances from vtables, vptrs, wide pointers, thunks, unsafe code, drop glue, virtual destructors, the Rule of Three, and me re-recording the live coding section like 5 times because I kept messing it up. the Sean Parent talk - godbolt to the demo - dyno - NonNull - thunk - std::function - std::any - I use the amazing Manim library for animating these videos, and I edit them with Blender and Audacity.