File: rtti.yo

package info (click to toggle)
c%2B%2B-annotations 8.2.0-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,804 kB
  • ctags: 2,845
  • sloc: cpp: 15,418; makefile: 2,473; ansic: 165; perl: 90; sh: 29
file content (19 lines) | stat: -rw-r--r-- 1,122 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
bf(C++) offers two ways to (run-time) hi(type identification: run-time)
retrieve the type of objects and expressions. The possibilities of bf(C++)'s
run-time type identification are limited compared to languages like
 hi(Java) bf(Java). Usually
    i(static type checking) and i(static type identification) is used in
bf(C++). Static type checking is possibly safer and certainly more efficient
than run-time type identification and should therefore be preferred over
run-time type identification. But situations exist where run-time type
identification is appropriate. bf(C++) offers run-time type identification
through the emi(dynamic cast) and ti(typeid) operators.
    itemization(
    it() A tt(dynamic_cast)  is 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 also known as emi(down-casting).
        it() The ti(typeid) operator returns the actual type of an expression.
            hi(expression: actual type)
    )
    These operators can be used with objects of classes having at least one
virtual member function.