aboutsummaryrefslogtreecommitdiff
path: root/lib/libcxx/include/__algorithm/min_element.h
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-05-09 01:52:26 -0700
committerAndrew Kelley <andrew@ziglang.org>2024-05-09 01:52:26 -0700
commitbcb534c295d5cc6fd63caa570cc08e6b148a507c (patch)
tree0b17cb1e632d894f50f25e550d5113f232b0e877 /lib/libcxx/include/__algorithm/min_element.h
parentd9b00ee4ba48717ff6b306a6f9419e7b604ac04b (diff)
parent74f52954b9cb40d59d80b839b45bb859146731a7 (diff)
downloadzig-bcb534c295d5cc6fd63caa570cc08e6b148a507c.tar.gz
zig-bcb534c295d5cc6fd63caa570cc08e6b148a507c.zip
Merge branch 'llvm18'
Upgrades the LLVM, Clang, and LLD dependencies to LLVM 18.x Related to #16270
Diffstat (limited to 'lib/libcxx/include/__algorithm/min_element.h')
-rw-r--r--lib/libcxx/include/__algorithm/min_element.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/libcxx/include/__algorithm/min_element.h b/lib/libcxx/include/__algorithm/min_element.h
index 45f3e85ef9..c576d66560 100644
--- a/lib/libcxx/include/__algorithm/min_element.h
+++ b/lib/libcxx/include/__algorithm/min_element.h
@@ -28,8 +28,8 @@ _LIBCPP_PUSH_MACROS
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _Comp, class _Iter, class _Sent, class _Proj>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
-_Iter __min_element(_Iter __first, _Sent __last, _Comp __comp, _Proj& __proj) {
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter
+__min_element(_Iter __first, _Sent __last, _Comp __comp, _Proj& __proj) {
if (__first == __last)
return __first;
@@ -42,29 +42,26 @@ _Iter __min_element(_Iter __first, _Sent __last, _Comp __comp, _Proj& __proj) {
}
template <class _Comp, class _Iter, class _Sent>
-_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
-_Iter __min_element(_Iter __first, _Sent __last, _Comp __comp) {
+_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Iter __min_element(_Iter __first, _Sent __last, _Comp __comp) {
auto __proj = __identity();
return std::__min_element<_Comp>(std::move(__first), std::move(__last), __comp, __proj);
}
template <class _ForwardIterator, class _Compare>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator
-min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
-{
- static_assert(__has_forward_iterator_category<_ForwardIterator>::value,
- "std::min_element requires a ForwardIterator");
- static_assert(__is_callable<_Compare, decltype(*__first), decltype(*__first)>::value,
- "The comparator has to be callable");
+min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) {
+ static_assert(
+ __has_forward_iterator_category<_ForwardIterator>::value, "std::min_element requires a ForwardIterator");
+ static_assert(
+ __is_callable<_Compare, decltype(*__first), decltype(*__first)>::value, "The comparator has to be callable");
return std::__min_element<__comp_ref_type<_Compare> >(std::move(__first), std::move(__last), __comp);
}
template <class _ForwardIterator>
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _ForwardIterator
-min_element(_ForwardIterator __first, _ForwardIterator __last)
-{
- return _VSTD::min_element(__first, __last, __less<>());
+min_element(_ForwardIterator __first, _ForwardIterator __last) {
+ return std::min_element(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD