mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-03 11:12:27 +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
33
third_party/libcxx/__algorithm/remove.h
vendored
33
third_party/libcxx/__algorithm/remove.h
vendored
|
@ -18,28 +18,29 @@
|
|||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_PUSH_MACROS
|
||||
#include <__undef_macros>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <class _ForwardIterator, class _Tp>
|
||||
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
|
||||
remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
|
||||
{
|
||||
__first = _VSTD::find(__first, __last, __value);
|
||||
if (__first != __last)
|
||||
{
|
||||
_ForwardIterator __i = __first;
|
||||
while (++__i != __last)
|
||||
{
|
||||
if (!(*__i == __value))
|
||||
{
|
||||
*__first = _VSTD::move(*__i);
|
||||
++__first;
|
||||
}
|
||||
}
|
||||
_LIBCPP_NODISCARD _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
|
||||
remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) {
|
||||
__first = std::find(__first, __last, __value);
|
||||
if (__first != __last) {
|
||||
_ForwardIterator __i = __first;
|
||||
while (++__i != __last) {
|
||||
if (!(*__i == __value)) {
|
||||
*__first = std::move(*__i);
|
||||
++__first;
|
||||
}
|
||||
}
|
||||
return __first;
|
||||
}
|
||||
return __first;
|
||||
}
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
_LIBCPP_POP_MACROS
|
||||
|
||||
#endif // _LIBCPP___ALGORITHM_REMOVE_H
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue