]>
Commit | Line | Data |
---|---|---|
b2dad0e3 BK |
1 | // 2000-03-29 sss/bkoz |
2 | ||
3 | // Copyright (C) 2000 Free Software Foundation, Inc. | |
4 | // | |
5 | // This file is part of the GNU ISO C++ Library. This library is free | |
6 | // software; you can redistribute it and/or modify it under the | |
7 | // terms of the GNU General Public License as published by the | |
8 | // Free Software Foundation; either version 2, or (at your option) | |
9 | // any later version. | |
10 | ||
11 | // This library is distributed in the hope that it will be useful, | |
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | // GNU General Public License for more details. | |
15 | ||
16 | // You should have received a copy of the GNU General Public License along | |
17 | // with this library; see the file COPYING. If not, write to the Free | |
18 | // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
19 | // USA. | |
20 | ||
21 | #include <algorithm> | |
aa1b2f7d | 22 | #include <debug_assert.h> |
b2dad0e3 BK |
23 | |
24 | void test01() | |
25 | { | |
26 | bool test = true; | |
27 | const int& x = std::max(1, 2); | |
28 | const int& y = std::max(3, 4); | |
aa1b2f7d BV |
29 | VERIFY( x == 2 ); |
30 | VERIFY( y == 4 ); | |
b2dad0e3 BK |
31 | |
32 | const int& z = std::min(1, 2); | |
33 | const int& w = std::min(3, 4); | |
aa1b2f7d BV |
34 | VERIFY( z == 1 ); |
35 | VERIFY( w == 3 ); | |
b2dad0e3 BK |
36 | |
37 | #ifdef DEBUG_ASSERT | |
38 | assert(test); | |
39 | #endif | |
40 | } | |
41 | ||
42 | int main() | |
43 | { | |
44 | test01(); | |
45 | return 0; | |
46 | } |