John Bandela “Polymorphism != Virtual: Easy, Flexible Runtime Polymorphism Without Inheritance”

Sdílet
Vložit
  • čas přidán 11. 10. 2019
  • CppCon.org
    -
    Discussion & Comments: / cpp
    -
    Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2019
    -
    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!
    -
    John Bandela
    Google LLC
    SWE
    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 Computer and Information Science. During my undergraduate time, I created and submitted Boost.Tokenizer. I went on to medical school and neurosurgery residency, but decided to do something with a little less scary undefined behavior and returned to programming in C++.
    -
    Videos Filmed & Edited by Bash Films: www.BashFilms.com
    *-----*
    Register Now For CppCon 2022: cppcon.org/registration/
    *-----*

Komentáře •