equal
deleted
inserted
replaced
|
1 #include <iostream> |
|
2 #include <exception> |
|
3 |
|
4 using namespace std; |
|
5 |
|
6 template<class T> |
|
7 void maxx(T a, T b) { |
|
8 if (a > b) |
|
9 cout << b << endl; |
|
10 else |
|
11 cout << a << endl; |
|
12 } |
|
13 |
|
14 void maxx(int a, int b) { |
|
15 cout << "handle ints special..." << endl; |
|
16 } |
|
17 |
|
18 int main(int argc, char **argv) |
|
19 { |
|
20 double d1=3.2, d2=5.2; |
|
21 |
|
22 try { |
|
23 maxx(3.5, 5.1); |
|
24 maxx(5, 1); |
|
25 maxx(d1, d2); |
|
26 } catch (exception &e) { |
|
27 cout << e.what(); |
|
28 } |
|
29 |
|
30 return 0; |
|
31 } |