-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Implement ranges::replace_copy_if #998
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| auto result = replace_copy_if( | ||
| wrapped_input.begin(), wrapped_input.end(), Write{output}, matches, P{47, 1}, get_second); | ||
| STATIC_ASSERT(same_as<decltype(result), replace_copy_if_result<iterator_t<Read>, Write>>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| STATIC_ASSERT(same_as<decltype(result), replace_copy_if_result<iterator_t<Read>, Write>>); | |
| STATIC_ASSERT(same_as<decltype(result), replace_copy_if_result<ranges::iterator_t<Read>, Write>>); | |
(And on 46.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to using declarations as in the other tests
|
Narf, I should really take thetime to read everything a second Time if I do not expect it to compileanyway. Sorry for the noise |
| template <class _It, class _Se, class _Ty, class _Out, class _Pj, class _Pr> | ||
| _NODISCARD static constexpr replace_copy_if_result<_It, _Out> _Replace_copy_if_unchecked( | ||
| _It _First, const _Se _Last, _Out _Result, _Pr _Pred, const _Ty& _Newval, _Pj _Proj) { | ||
| // copy [_First, _Last) to _Out while replacing _Oldval with _Newval if projected _Oldval fulfuills _Pred |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo, and _Out is a type while _Result is a variable:
| // copy [_First, _Last) to _Out while replacing _Oldval with _Newval if projected _Oldval fulfuills _Pred | |
| // copy [_First, _Last) to _Result while replacing _Oldval with _Newval if projected _Oldval fulfills _Pred |
|
Dropping in favor of #983 |
This implements ranges::replace_copy_if
There is still the compile error wrt
indirect_copyablesame as forreplace_copy