File: rtti.yo

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (19 lines) | stat: -rw-r--r-- 1,120 bytes parent folder | download | duplicates (5)
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 hi(type identification: run-time) retrieve types of
objects and expressions at run-time. 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.