aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__algorithm/min.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-11-20 17:36:30 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-11-20 17:36:30 +0000
commit846a2208a8ab099f595fe7e8b2e6d54a7b5e67fb (patch)
tree73c1a7a230c8bb19317a3893d937c4d8a219e91c /libcxx/include/__algorithm/min.h
parentc0981da47d5696fe36474fcf86b4ce03ae3ff818 (diff)
Diffstat (limited to 'libcxx/include/__algorithm/min.h')
-rw-r--r--libcxx/include/__algorithm/min.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/include/__algorithm/min.h b/libcxx/include/__algorithm/min.h
index 9fea7f70a2bb..5cacb2f28e7e 100644
--- a/libcxx/include/__algorithm/min.h
+++ b/libcxx/include/__algorithm/min.h
@@ -11,6 +11,7 @@
#include <__config>
#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
#include <__algorithm/min_element.h>
#include <initializer_list>
@@ -49,7 +50,8 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp
min(initializer_list<_Tp> __t, _Compare __comp)
{
- return *_VSTD::min_element(__t.begin(), __t.end(), __comp);
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return *_VSTD::__min_element<_Comp_ref>(__t.begin(), __t.end(), __comp);
}
template<class _Tp>