18.3 Run-Time Type Information 793
short sValue;
short& rsValue = sValue;
short* psValue = &sValue;
class SomeClass
{
public:
SomeClass ();
SomeClass (const SomeClass& rkObject);
protected:
enum { NOTHING, SOMETHING, SOMETHING_ELSE };
int m_eSomeFlag;
};
The rules of style in the code are not listed here and can be inferred from reading
any of the source files.
18.3 Run-Time Type Information
Polymorphism provides abstraction of functionality. A polymorphic function call
can be made regardless of the true type of the calling object. But there are times when
you need to know the type of the polymorphic object, or you need to determine if the
object’s t ype is derived from a specified type—for example, to safely typecast a base
class pointer to a derived-class pointer ...