aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/__algorithm/replace_if.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-12-25 13:49:57 +0000
committerDimitry Andric <dim@FreeBSD.org>2023-12-25 13:49:57 +0000
commit99aabd70801bd4bc72c4942747f6d62c675112f5 (patch)
tree02bf056e9098f5ecddc7f18a99db9c79f4404b02 /libcxx/include/__algorithm/replace_if.h
parent312c0ed19cc5276a17bacf2120097bec4515b0f1 (diff)
Diffstat (limited to 'libcxx/include/__algorithm/replace_if.h')
-rw-r--r--libcxx/include/__algorithm/replace_if.h12
1 files changed, 5 insertions, 7 deletions
diff --git a/libcxx/include/__algorithm/replace_if.h b/libcxx/include/__algorithm/replace_if.h
index 05269065f025..78487e3deed7 100644
--- a/libcxx/include/__algorithm/replace_if.h
+++ b/libcxx/include/__algorithm/replace_if.h
@@ -18,13 +18,11 @@
_LIBCPP_BEGIN_NAMESPACE_STD
template <class _ForwardIterator, class _Predicate, class _Tp>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-void
-replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value)
-{
- for (; __first != __last; ++__first)
- if (__pred(*__first))
- *__first = __new_value;
+inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void
+replace_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, const _Tp& __new_value) {
+ for (; __first != __last; ++__first)
+ if (__pred(*__first))
+ *__first = __new_value;
}
_LIBCPP_END_NAMESPACE_STD