A Trait worse than death
Going back many a year before C++ was in general circulation I had occasion to write a graphics library. It would need to be able to use a couple of different screen based APIs and also assorted pen plotters. To this end the individual drivers populated a virtual function table that would be called by the API layer. In effect a manual implementation of a C++ class system with "virtual" methods. The need for languages to have these sorts of mechanisms is clear. Of late languages have broken away from C++ classes. Golang has instead the idea of an interface, the definition of an interface specifies what functions (no variables) that interface has. At that point any struct that contains all those functions can call a function that wants the interface as a parameter. It's a great concept, very flexible, a struct might satisfy any number of different interfaces without the need for inheritance. Rust decides to change the game again and has traits which are like interfaces but ...