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 //===----------------------------------------------------------------------===//
12 // template<class T, class Compare>
14 // min(initializer_list<T> t, Compare comp);
22 #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
23 int i = std::min({2, 3, 1}, std::greater<int>());
25 i = std::min({2, 1, 3}, std::greater<int>());
27 i = std::min({3, 1, 2}, std::greater<int>());
29 i = std::min({3, 2, 1}, std::greater<int>());
31 i = std::min({1, 2, 3}, std::greater<int>());
33 i = std::min({1, 3, 2}, std::greater<int>());
35 #if _LIBCPP_STD_VER > 11
37 static_assert(std::min({1, 3, 2}, std::greater<int>()) == 3, "");
38 static_assert(std::min({2, 1, 3}, std::greater<int>()) == 3, "");
39 static_assert(std::min({3, 2, 1}, std::greater<int>()) == 3, "");
42 #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS