Eduardo Madrid - "Type-Erasing the Pains of Runtime Polymorphism: The Practical Part" - C++ London

Sdílet
Vložit
  • čas přidán 23. 12. 2020
  • Object Oriented interfaces are one of the most powerful tools in all of software engineering, we design an interface capturing the behaviors our subtypes should have and then make concrete implementations; but interface inheritance has modeling limitations and the core language feature of inheritance and virtual overrides inflicts on us several pains that fortunately we can avoid, because C++ is such a powerful language we can use some of its features to synthesize the equivalent of others, only better in some key aspects. We have implemented an open source framework that does exactly that, and this framework is “production-strength”, including being used in Snapchat, an application with hundreds of millions of daily active users; hence this is ready for the attendees to start benefiting from, especially if we explain with lots of examples, Catch2 tests and benchmarks, compiler explorer links how to use it.
    Type-erasure is the technique at the root of the magical powers of std::function, however, its other implementations are very inefficient as shown in our CPPCon presentation. In this presentation we will generalize quite a lot what we can do with things like std::function.
    In particular inheritance and overrides:
    1. Have important performance/efficiency drawbacks that can be avoided
    2. Are “intrusive” of otherwise perfectly good types already implemented, force us to make “wrappers”, but type-erasure allows us to just use existing types.
    3. Are very limited in their modeling powers, however, zoo lets us go beyond.
    This presentation also works as the introduction to the deeper and more technical aspects of the theory and implementation of type erasure in the zoo libraries I have been communicating publicly.
    ---
    This talk was given at C++ London, December 2020
    www.meetup.com/CppLondon/even...
  • Věda a technologie

Komentáře • 3

  • @cppmsg
    @cppmsg Před 8 měsíci

    Good talk. I have searched for the slides, anyone know where they are?

  • @cppmsg
    @cppmsg Před 8 měsíci

    I googled for >>john lakos std::vector::at()