Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions stl/inc/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -1380,31 +1380,7 @@ namespace ranges {

inline constexpr _None_of_fn none_of{_Not_quite_object::_Construct_tag{}};

// ALIAS TEMPLATE copy_result
template <class _In, class _Out>
using copy_result = in_out_result<_In, _Out>;

// VARIABLE ranges::copy
// clang-format off
template <input_iterator _It, sentinel_for<_It> _Se, weakly_incrementable _Out>
requires indirectly_copyable<_It, _Out>
_NODISCARD constexpr copy_result<_It, _Out> _Copy_unchecked(_It _First, _Se _Last, _Out _Result) {
if constexpr (_Ptr_copy_cat<_It, _Out>::_Trivially_copyable && sized_sentinel_for<_Se, _It>) {
if (!_STD is_constant_evaluated()) {
auto _Final = _RANGES next(_First, _STD move(_Last));
_Result = _Copy_memmove(_STD move(_First), _Final, _STD move(_Result));
return {_STD move(_Final), _STD move(_Result)};
}
}

for (; _First != _Last; ++_First, (void) ++_Result) {
*_Result = *_First;
}

return {_STD move(_First), _STD move(_Result)};
}
// clang-format on

class _Copy_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;
Expand Down Expand Up @@ -3534,42 +3510,6 @@ namespace ranges {

inline constexpr _Fill_fn fill{_Not_quite_object::_Construct_tag{}};

// VARIABLE ranges::fill_n
class _Fill_n_fn : private _Not_quite_object {
public:
using _Not_quite_object::_Not_quite_object;

template <class _Ty, output_iterator<const _Ty&> _It>
constexpr _It operator()(_It _First, iter_difference_t<_It> _Count, const _Ty& _Value) const {
if (_Count > 0) {
auto _UFirst = _Get_unwrapped_n(_STD move(_First), _Count);
if (!_STD is_constant_evaluated()) {
if constexpr (_Fill_memset_is_safe<decltype(_UFirst), _Ty>) {
_Fill_memset(_UFirst, _Value, static_cast<size_t>(_Count));
_Seek_wrapped(_First, _UFirst + _Count); // no need to move since _UFirst is a pointer
return _First;
} else if constexpr (_Fill_zero_memset_is_safe<decltype(_UFirst), _Ty>) {
if (_Is_all_bits_zero(_Value)) {
_Fill_zero_memset(_UFirst, static_cast<size_t>(_Count));
_Seek_wrapped(_First, _UFirst + _Count); // no need to move since _UFirst is a pointer
return _First;
}
}
}

for (; _Count > 0; ++_UFirst, (void) --_Count) {
*_UFirst = _Value;
}

_Seek_wrapped(_First, _STD move(_UFirst));
}

return _First;
}
};

inline constexpr _Fill_n_fn fill_n{_Not_quite_object::_Construct_tag{}};

// VARIABLE ranges::generate
class _Generate_fn : private _Not_quite_object {
public:
Expand Down
Loading