aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__algorithm/min_element.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-12-25 17:35:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2024-04-06 20:13:06 +0000
commitcb14a3fe5122c879eae1fb480ed7ce82a699ddb6 (patch)
treeb983a613c35ece61d561b5a9ef9cd66419f6c7fb /contrib/llvm-project/libcxx/include/__algorithm/min_element.h
parent3d68ee6cbdb244de9fab1df8a2525d2fa592571e (diff)
parent99aabd70801bd4bc72c4942747f6d62c675112f5 (diff)
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__algorithm/min_element.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__algorithm/min_element.h23
1 files changed, 10 insertions, 13 deletions
diff --git a/contrib/llvm-project/libcxx/include/__algorithm/min_element.h b/contrib/llvm-project/libcxx/include/__algorithm/min_element.h
index 0ce7af69333f..c576d665601d 100644
--- a/contrib/llvm-project/libcxx/include/__algorithm/min_element.h
+++ b/contrib/llvm-project/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 std::min_element(__first, __last, __less<>());
+min_element(_ForwardIterator __first, _ForwardIterator __last) {
+ return std::min_element(__first, __last, __less<>());
}
_LIBCPP_END_NAMESPACE_STD