This is an archive of the discontinued LLVM Phabricator instance.

[libc++][PSTL] Implement std::replace{,_if,_copy,_copy_if}
ClosedPublic

Authored by philnik on May 31 2023, 2:03 PM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Commits
rG51131edf83e4: [libc++][PSTL] Implement std::replace{,_if,_copy,_copy_if}

Diff Detail

Event Timeline

philnik created this revision.May 31 2023, 2:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2023, 2:03 PM
philnik requested review of this revision.May 31 2023, 2:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 31 2023, 2:03 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik updated this revision to Diff 527482.Jun 1 2023, 10:20 AM

Try to fix CI

ldionne requested changes to this revision.Jun 2 2023, 12:07 PM
ldionne added a subscriber: ldionne.
ldionne added inline comments.
libcxx/include/CMakeLists.txt
85

Can we remove any old PSTL code with this patch?

libcxx/test/std/algorithms/alg.modifying.operations/alg.replace/pstl.replace.pass.cpp
30

There needs to be a test with a non-empty range but no match. Here and everywhere.

31

Needs a test where you "match" more than one element in the range. For example

std::array a = {1, 2, 3, 4, 3, 3, 5, 6, 3};
// then replace 3 by 9, you need to end up with {1, 2, 9, 4, 9, 9, 5, 6, 9}

This comment applies to all the other algorithms as well.

This revision now requires changes to proceed.Jun 2 2023, 12:07 PM
philnik updated this revision to Diff 528540.Jun 5 2023, 12:15 PM
philnik marked 3 inline comments as done.

Address comments

philnik updated this revision to Diff 528602.Jun 5 2023, 3:23 PM

Try to fix CI

ldionne accepted this revision.Jun 6 2023, 8:07 AM
This revision is now accepted and ready to land.Jun 6 2023, 8:07 AM
This revision was automatically updated to reflect the committed changes.