Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
wire-cell-build
util
test
test_decl.cxx
Go to the documentation of this file.
1
#include <iostream>
2
#include <typeinfo>
3
using namespace
std
;
4
5
struct
Base
{
6
virtual
~Base
() {}
7
virtual
void
any() = 0;
8
};
9
struct
A
:
public
Base
{
10
virtual
~A
() {}
11
12
void
a
() {
13
cerr <<
"Hi (a)\n"
;
14
}
15
16
virtual
void
any
() {
17
cerr <<
"Hi from any (a)\n"
;
18
}
19
};
20
struct
B
:
public
Base
{
21
virtual
~B
() {}
22
void
b
() {
23
cerr <<
"Hi (b)\n"
;
24
}
25
26
virtual
void
any
() {
27
cerr <<
"Hi from any (b)\n"
;
28
}
29
};
30
31
Base
*
make_a
() {
return
new
A
; }
32
Base
*
make_b
() {
return
new
B
; }
33
34
int
main
()
35
{
36
auto
*
a
=
make_a
(), *
b
=
make_b
();
37
a
->any();
38
b
->any();
39
40
typedef
decltype(*
a
) MyA;
41
cerr <<
typeid
(MyA).
name
() <<
endl
;
42
43
// decltype(*a)* aa = dynamic_cast<decltype(*a)*>(a);
44
45
// aa->any();
46
// aa->a();
47
48
49
return
0;
50
}
name
static QCString name
Definition:
declinfo.cpp:673
Base
Definition:
value_ptr_test.cc:17
B
Definition:
pointersEqual_t.cc:9
A::any
virtual void any()
Definition:
test_decl.cxx:16
A::a
void a()
Definition:
test_decl.cxx:12
make_b
Base * make_b()
Definition:
test_decl.cxx:32
main
int main()
Definition:
test_decl.cxx:34
std
STL namespace.
make_a
Base * make_a()
Definition:
test_decl.cxx:31
B::any
virtual void any()
Definition:
test_decl.cxx:26
B::b
void b()
Definition:
test_decl.cxx:22
a
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition:
pointer.h:1124
Base::~Base
virtual ~Base()
Definition:
test_decl.cxx:6
B::~B
virtual ~B()
Definition:
test_decl.cxx:21
A::~A
virtual ~A()
Definition:
test_decl.cxx:10
B
Autolink_Test B
Definition:
autolink.cpp:95
A
#define A
Definition:
memgrp.cpp:38
b
static bool * b
Definition:
config.cpp:1043
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11