repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Update ChangeLogs and version numbers for 2.95.3 release
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
typeid2.C
blob
64ecc5a17f5cb26dbe37e35d7b58eb776e0fe868
1
// PRMS Id: 11596
2
3
#include <typeinfo>
4
extern "C" int printf (const char *, ...);
5
6
class Chicken
7
{
8
public:
9
int eggs_per_day;
10
};
11
12
template <class Bird>
13
class Flock
14
{
15
public:
16
Bird * flock_head;
17
int head_count;
18
void print_self() {
19
printf ("A flock of %d %ss\n", head_count, typeid (Bird).name ());
20
printf ("A flock of %d %ss\n", head_count, typeid (*flock_head).name ());
21
}
22
};
23
24
int main()
25
{
26
Flock<Chicken> x;
27
printf ("%s\n", typeid(x).name());
28
x.head_count = 42;
29
x.print_self();
30
}