File: rtti.yo

package info (click to toggle)
c%2B%2B-annotations 7.2.0-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 11,484 kB
  • ctags: 2,902
  • sloc: cpp: 15,844; makefile: 2,997; ansic: 165; perl: 90; sh: 29
file content (18 lines) | stat: -rw-r--r-- 1,076 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
bf(C++) offers two ways to i(retrieve the type of objects) and expressions
while the program is running. The possibilities of bf(C++)'s
    emi(run-time type identification) are limited compared to
languages like hi(Java) bf(Java). Normally, bf(C++) uses
    i(static type checking) and i(static type identification). Static type
checking and determination is possibly safer and certainly more efficient than
run-time type identification, and should therefore be used wherever
possible. Nonetheles, bf(C++) offers run-time type identification by providing
the emi(dynamic cast) and ti(typeid) operators.
    itemization(
    it() The ti(dynamic_cast<>()) operator can be used to convert a base
class hi(base class: converting to derived class) pointer or reference to a
derived class pointer or reference. This is called emi(down-casting).
        it() The ti(typeid) operator returns the actual type of an expression.
            hi(expression: actual type)
    )
    These operators operate on class type objects, containing at least one
        i(virtual member function).