什么是RTTI What is RTTI

RTTI即运行时类型识别,用来识别动态对象的类型。即使我们仅仅有基类的指针和引用,可以识别出该指针和引用所指向那个类(基类或派生类)。RTTI会带来一定的性能开销。

 

Runtime type identification allows us to find the dynamic type of an object when we have only a pointer or a reference of the base type. It comes at a cost of performance penalty.

你可能感兴趣的:(object,performance,reference)