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, StrictWeakOrder<auto, T> Compare>
13 // requires !SameType<T, Compare> && CopyConstructible<Compare>
15 // min(const T& a, const T& b, Compare comp);
21 #include "test_macros.h"
23 template <class T, class C>
25 test(const T& a, const T& b, C c, const T& x)
27 assert(&std::min(a, b, c) == &x);
35 test(x, y, std::greater<int>(), x);
36 test(y, x, std::greater<int>(), y);
41 test(x, y, std::greater<int>(), y);
42 test(y, x, std::greater<int>(), y);
47 test(x, y, std::greater<int>(), x);
48 test(y, x, std::greater<int>(), x);
50 #if TEST_STD_VER >= 14
54 static_assert(std::min(x, y, std::greater<int>()) == x, "" );
55 static_assert(std::min(y, x, std::greater<int>()) == x, "" );