摘要
RTTI是C++的主要特性之一,它允许用一个匿名的多态指针来发现类型信息。为了从本质上理解RTTI的精髓,充分发挥它的特性,以MFC为例,讨论了如何在库中实现自己的RTTI,通过对MFC中与RTTI有关的宏展开代码的抽象和改进,从概念和理论上简要模拟了RTTI的部分实现机制。经过证明,在理论上是可行的。
RTTI is one of the primary characteristics of C++ language. Information of type with a anonymous polymorphous pointer by the technology Can be discovered. In order to understand the essence of RTTI and make the best use of it's characteristics, take the MFC for example, discuss how to realize your own RTTI in the library. Through abstracting and improving the code of macro about RTTI, simulate part of the mechanism of RTTI in conception and theory. It's proved to be feasible in theory.
出处
《微机发展》
2003年第a01期62-64,共3页
Microcomputer Development