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 // max(const T& a, const T& b, Compare comp);
21 template <class T, class C>
23 test(const T& a, const T& b, C c, const T& x)
25 assert(&std::max(a, b, c) == &x);
33 test(x, y, std::greater<int>(), x);
34 test(y, x, std::greater<int>(), y);
39 test(x, y, std::greater<int>(), x);
40 test(y, x, std::greater<int>(), x);
45 test(x, y, std::greater<int>(), y);
46 test(y, x, std::greater<int>(), y);
48 #if _LIBCPP_STD_VER > 11
52 static_assert(std::max(x, y, std::greater<int>()) == y, "" );
53 static_assert(std::max(y, x, std::greater<int>()) == y, "" );