mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-10-04 13:41:02 +00:00
Release Cosmopolitan v3.6.0
This release is an atomic upgrade to GCC 14.1.0 with C23 and C++23
This commit is contained in:
parent
62ace3623a
commit
5660ec4741
1585 changed files with 117353 additions and 271644 deletions
38
third_party/libcxx/__algorithm/ranges_replace.h
vendored
38
third_party/libcxx/__algorithm/ranges_replace.h
vendored
|
@ -24,6 +24,9 @@
|
|||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
#if _LIBCPP_STD_VER >= 20
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
@ -31,39 +34,28 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
namespace ranges {
|
||||
namespace __replace {
|
||||
struct __fn {
|
||||
|
||||
template <input_iterator _Iter, sentinel_for<_Iter> _Sent,
|
||||
class _Type1,
|
||||
class _Type2,
|
||||
class _Proj = identity>
|
||||
requires indirectly_writable<_Iter, const _Type2&>
|
||||
&& indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type1*>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr
|
||||
_Iter operator()(_Iter __first, _Sent __last,
|
||||
const _Type1& __old_value,
|
||||
const _Type2& __new_value,
|
||||
_Proj __proj = {}) const {
|
||||
auto __pred = [&](const auto& __val) { return __val == __old_value; };
|
||||
template <input_iterator _Iter, sentinel_for<_Iter> _Sent, class _Type1, class _Type2, class _Proj = identity>
|
||||
requires indirectly_writable<_Iter, const _Type2&> &&
|
||||
indirect_binary_predicate<ranges::equal_to, projected<_Iter, _Proj>, const _Type1*>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr _Iter operator()(
|
||||
_Iter __first, _Sent __last, const _Type1& __old_value, const _Type2& __new_value, _Proj __proj = {}) const {
|
||||
auto __pred = [&](const auto& __val) -> bool { return __val == __old_value; };
|
||||
return ranges::__replace_if_impl(std::move(__first), std::move(__last), __pred, __new_value, __proj);
|
||||
}
|
||||
|
||||
template <input_range _Range,
|
||||
class _Type1,
|
||||
class _Type2,
|
||||
class _Proj = identity>
|
||||
requires indirectly_writable<iterator_t<_Range>, const _Type2&>
|
||||
&& indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type1*>
|
||||
template <input_range _Range, class _Type1, class _Type2, class _Proj = identity>
|
||||
requires indirectly_writable<iterator_t<_Range>, const _Type2&> &&
|
||||
indirect_binary_predicate<ranges::equal_to, projected<iterator_t<_Range>, _Proj>, const _Type1*>
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr borrowed_iterator_t<_Range>
|
||||
operator()(_Range&& __range, const _Type1& __old_value, const _Type2& __new_value, _Proj __proj = {}) const {
|
||||
auto __pred = [&](auto&& __val) { return __val == __old_value; };
|
||||
auto __pred = [&](auto&& __val) -> bool { return __val == __old_value; };
|
||||
return ranges::__replace_if_impl(ranges::begin(__range), ranges::end(__range), __pred, __new_value, __proj);
|
||||
}
|
||||
|
||||
};
|
||||
} // namespace __replace
|
||||
|
||||
inline namespace __cpo {
|
||||
inline constexpr auto replace = __replace::__fn{};
|
||||
inline constexpr auto replace = __replace::__fn{};
|
||||
} // namespace __cpo
|
||||
} // namespace ranges
|
||||
|
||||
|
@ -71,4 +63,6 @@ _LIBCPP_END_NAMESPACE_STD
|
|||
|
||||
#endif // _LIBCPP_STD_VER >= 20
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#endif // _LIBCPP___ALGORITHM_RANGES_REPLACE_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue