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
cp:
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.pt
/
parms1.C
1
// Testcase for use of template parms as types for other template parms.
2
3
template <class T, T t>
4
class A {
5
T a;
6
public:
7
A(): a(t) {}
8
9
operator T () { return a; }
10
};
11
12
template <class S, S s>
13
class B {
14
A<S,s> a;
15
public:
16
B(A<S,s>& b): a(b) {}
17
18
operator S () { return a*20; }
19
};
20
21
int
22
main()
23
{
24
A<int, 5> a;
25
B<int, 5> b(a);
26
27
if (b * a == 500)
28
return 0;
29
else
30
return 1;
31
}