Loading…
CppCon 2019 has ended
Friday, September 20 • 10:30 - 11:30
Polymorphism != Virtual: Easy, Flexible Runtime Polymorphism Without Inheritance

Log in to save this to your schedule and see who's attending!

Many C++ programmers, automatically think of virtual when they hear 'polymorphism'. However, there are better, more flexible ways to have polymorphism without using virtual. This talk will show how to achieve that.

We will start by looking at static and runtime polymorphism and discuss the advantages and disadvantages of each. Then we will take a look at 'virtual', looking at how it is implemented and the disadvantages of inheritance based polymorphism it entails.

With that background in place, we will demonstrate a technique using C++17 that combines some of the best features of static and runtime polymorphism without using inheritance while still being easy to use.

If you ever watched Sean Parent's talk "Inheritance Is The Base Class of Evil" and wanted an easier way to achieve what he achieved without the boilerplate, this talk is especially for you!

Speakers
avatar for John Bandela

John Bandela

SWE, Google LLC
I first started programming in C++ at age 14 in 1994 when I cajoled my parents into buying me Visual C++ 1.0 for my birthday. It took a while, but as I learned the language, I decided I really liked C++. I attended the University of Florida and obtained my undergraduate degree in... Read More →


Friday September 20, 2019 10:30 - 11:30
Aurora A

Attendees (407)




Twitter Feed