Previous section   Next section

Imperfect C++ Practical Solutions for Real-Life Programming
By Matthew Wilson
Table of Contents
Part Two.  Surviving the Real World


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?


      Previous section   Next section