1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // UNSUPPORTED: c++98, c++03
14 // template<class T, class Compare>
16 // min(initializer_list<T> t, Compare comp);
22 #include "test_macros.h"
26 int i = std::min({2, 3, 1}, std::greater<int>());
28 i = std::min({2, 1, 3}, std::greater<int>());
30 i = std::min({3, 1, 2}, std::greater<int>());
32 i = std::min({3, 2, 1}, std::greater<int>());
34 i = std::min({1, 2, 3}, std::greater<int>());
36 i = std::min({1, 3, 2}, std::greater<int>());
38 #if TEST_STD_VER >= 14
40 static_assert(std::min({1, 3, 2}, std::greater<int>()) == 3, "");
41 static_assert(std::min({2, 1, 3}, std::greater<int>()) == 3, "");
42 static_assert(std::min({3, 2, 1}, std::greater<int>()) == 3, "");