diff options
Diffstat (limited to 'salhelper/test/rtti/rttitest.cxx')
-rw-r--r-- | salhelper/test/rtti/rttitest.cxx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/salhelper/test/rtti/rttitest.cxx b/salhelper/test/rtti/rttitest.cxx new file mode 100644 index 000000000000..ad03f3dc7960 --- /dev/null +++ b/salhelper/test/rtti/rttitest.cxx @@ -0,0 +1,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; +} |