OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
new
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.pt
/
ttp28.C
1
template<class T> class D
2
{
3
public:
4
int f();
5
};
6
7
template<class T> int D<T>::f()
8
{
9
return sizeof(T);
10
}
11
12
template<template<class> class D,class E> class C
13
{
14
D<E> d;
15
public:
16
int f() { return d.f(); }
17
};
18
19
template<template<class> class D,class E> int f(D<E> &d1)
20
{
21
d1.f();
22
C<D,E> d2;
23
d2.f();
24
return 0;
25
}
26
27
template<> int f<>(D<char> &d1)
28
{
29
d1.f();
30
return 0;
31
}
32
33
int main()
34
{
35
D<int> c1;
36
D<char> c2;
37
f(c1);
38
f(c2);
39
}