Evolving a language in and for the real world: C++ 1991-2006
Proceedings of the third ACM SIGPLAN conference on History of programming languages
GPCE '07 Proceedings of the 6th international conference on Generative programming and component engineering
Design and evaluation of C++ open multi-methods
Science of Computer Programming
Keynote speech: abstraction and the c++ machine model
ICESS'04 Proceedings of the First international conference on Embedded Software and Systems
Open and efficient type switch for C++
Proceedings of the ACM international conference on Object oriented programming systems languages and applications
Hi-index | 0.00 |
We describe a scheme for implementing dynamic casts suitable for systems where the performance and predictability of performance is essential. A dynamic cast from a base class to a derived class in an object-oriented language can be performed quickly by having the linker assign an integer type ID to each class. A simple integer arithmetic operation verifies whether the cast is legal at run time. The type ID scheme presented uses the modulo function to check that one class derives from another. A 64-bit type ID is sufficient to handle class hierarchies of large size at least nine levels of derivation deep. We also discuss the pointer adjustments required for a C++ dynamic_cast. All examples will be drawn from the C++ language. Copyright © 2005 John Wiley & Sons, Ltd.