summaryrefslogtreecommitdiff
path: root/salhelper/test/rtti/rttitest.cxx
blob: ad03f3dc7960f533a5278a89668666ec012e2d6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <rtl/ustring>
#include <stdio.h>
#include <typeinfo>
#include "samplelibrtti.hxx"


//using namespace salhelper;
using namespace rtl;



int main( int argc, char *argv[ ], char *envp[ ] )
{
    MyClassB b;
    MyClassA* pA= &b;
    // test the virtual function
    pA->funcA();

//  const type_info& i1= typeid ( b);
//  const type_info& i2= typeid( pA);

    if( typeid( b) == typeid( pA))
        printf("\nsame types");


    MyClassB* pB= dynamic_cast<MyClassB* >( pA);
        pB->funcA();
    return 0;
}