111
|
1 // { dg-do compile }
|
|
2
|
|
3 int a, b;
|
|
4 typedef double (*NormFunc) (const int &);
|
|
5 int &
|
|
6 max (int &p1, int &p2)
|
|
7 {
|
|
8 if (p1 < p2)
|
|
9 return p2;
|
|
10 return p1;
|
|
11 }
|
|
12
|
|
13 struct A
|
|
14 {
|
|
15 int operator () (int p1, int p2)
|
|
16 {
|
|
17 return max (p1, p2);
|
|
18 }
|
|
19 };
|
|
20 template < class, class > double
|
|
21 norm_ (const int &)
|
|
22 {
|
|
23 char c, d;
|
|
24 A e;
|
|
25 for (; a; a++)
|
|
26 {
|
|
27 b = e (b, d);
|
|
28 b = e (b, c);
|
|
29 }
|
131
|
30
|
|
31 return 0.0;
|
111
|
32 }
|
|
33
|
|
34 void
|
|
35 norm ()
|
|
36 {
|
|
37 static NormFunc f = norm_ < int, A >;
|
|
38 f = 0;
|
|
39 }
|
|
40
|