diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2023-12-25 13:49:57 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2023-12-25 13:49:57 +0000 |
| commit | 99aabd70801bd4bc72c4942747f6d62c675112f5 (patch) | |
| tree | 02bf056e9098f5ecddc7f18a99db9c79f4404b02 /libcxx/include/__algorithm/replace.h | |
| parent | 312c0ed19cc5276a17bacf2120097bec4515b0f1 (diff) | |
Diffstat (limited to 'libcxx/include/__algorithm/replace.h')
| -rw-r--r-- | libcxx/include/__algorithm/replace.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libcxx/include/__algorithm/replace.h b/libcxx/include/__algorithm/replace.h index 09b1dac79b70..8057c78686e1 100644 --- a/libcxx/include/__algorithm/replace.h +++ b/libcxx/include/__algorithm/replace.h @@ -18,13 +18,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD template <class _ForwardIterator, class _Tp> -inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 -void -replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value) -{ - for (; __first != __last; ++__first) - if (*__first == __old_value) - *__first = __new_value; +inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void +replace(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __old_value, const _Tp& __new_value) { + for (; __first != __last; ++__first) + if (*__first == __old_value) + *__first = __new_value; } _LIBCPP_END_NAMESPACE_STD |
