Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
Howard Hinnant | f5256e1 | 2010-05-11 21:36:01 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // <algorithm> |
| 11 | |
Howard Hinnant | eb564e7 | 2010-08-22 00:08:10 +0000 | [diff] [blame] | 12 | // template <class T> |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 13 | // T |
| 14 | // max(initializer_list<T> t); |
| 15 | |
| 16 | #include <algorithm> |
| 17 | #include <cassert> |
| 18 | |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 19 | int main() |
| 20 | { |
Howard Hinnant | 98e5d97 | 2010-08-21 20:10:01 +0000 | [diff] [blame] | 21 | #ifdef _LIBCPP_MOVE |
| 22 | int i = std::max({2, 3, 1}); |
| 23 | assert(i == 3); |
| 24 | i = std::max({2, 1, 3}); |
| 25 | assert(i == 3); |
| 26 | i = std::max({3, 1, 2}); |
| 27 | assert(i == 3); |
| 28 | i = std::max({3, 2, 1}); |
| 29 | assert(i == 3); |
| 30 | i = std::max({1, 2, 3}); |
| 31 | assert(i == 3); |
| 32 | i = std::max({1, 3, 2}); |
| 33 | assert(i == 3); |
Howard Hinnant | eb564e7 | 2010-08-22 00:08:10 +0000 | [diff] [blame] | 34 | #endif // _LIBCPP_MOVE |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 35 | } |