aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__algorithm/is_sorted.h
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/__algorithm/is_sorted.h')
-rw-r--r--libcxx/include/__algorithm/is_sorted.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/include/__algorithm/is_sorted.h b/libcxx/include/__algorithm/is_sorted.h
index c6954934e8c0..57953295a888 100644
--- a/libcxx/include/__algorithm/is_sorted.h
+++ b/libcxx/include/__algorithm/is_sorted.h
@@ -10,6 +10,7 @@
#define _LIBCPP___ALGORITHM_IS_SORTED_H
#include <__algorithm/comp.h>
+#include <__algorithm/comp_ref_type.h>
#include <__algorithm/is_sorted_until.h>
#include <__config>
#include <__iterator/iterator_traits.h>
@@ -26,7 +27,8 @@ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
bool
is_sorted(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
- return _VSTD::is_sorted_until(__first, __last, __comp) == __last;
+ typedef typename __comp_ref_type<_Compare>::type _Comp_ref;
+ return _VSTD::__is_sorted_until<_Comp_ref>(__first, __last, __comp) == __last;
}
template<class _ForwardIterator>