O'Reilly logo

Imperfect C++ Practical Solutions for Real-Life Programming by Matthew Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Objects Across Borders

We've seen how we can get a workable ABI if we restrict ourselves to C functions and how to provide a modest enhancement to this in the provision of overloaded functions for use in C++ compilation units. For all that that seems restrictive, a lot can be achieved with this API-based approach. We've also seen how we can portably emulate non-polymorphic classes by using a handle-based approach.

But we're still not up to passing objects around, and both of these techniques have restrictions on the types that can be manipulated by their functions. Conspicuous by its absence is one of C++'s most important features: run time polymorphism. Can we do better?

Mostly Portable vtables?

Anyone who has done any COM programming ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required