diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2021-11-20 17:39:12 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2022-06-04 11:58:59 +0000 |
| commit | 1f6fd64fe9c996b4795ee4a6c66b8f9216747560 (patch) | |
| tree | f0dce1f53c7da9228c69dde85abda66541a6206e /contrib/llvm-project/libcxx/include/__algorithm/max.h | |
| parent | 4b6eb0e63c698094db5506763df44cc83c19f643 (diff) | |
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__algorithm/max.h')
| -rw-r--r-- | contrib/llvm-project/libcxx/include/__algorithm/max.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/llvm-project/libcxx/include/__algorithm/max.h b/contrib/llvm-project/libcxx/include/__algorithm/max.h index 2fa97cad87f6..79cbd2be86b6 100644 --- a/contrib/llvm-project/libcxx/include/__algorithm/max.h +++ b/contrib/llvm-project/libcxx/include/__algorithm/max.h @@ -11,6 +11,7 @@ #include <__config> #include <__algorithm/comp.h> +#include <__algorithm/comp_ref_type.h> #include <__algorithm/max_element.h> #include <initializer_list> @@ -49,7 +50,8 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Tp max(initializer_list<_Tp> __t, _Compare __comp) { - return *_VSTD::max_element(__t.begin(), __t.end(), __comp); + typedef typename __comp_ref_type<_Compare>::type _Comp_ref; + return *_VSTD::__max_element<_Comp_ref>(__t.begin(), __t.end(), __comp); } template<class _Tp> |
