This is an archive of the discontinued LLVM Phabricator instance.

[libc++][ranges] Add ranges::in_found_result
ClosedPublic

Authored by philnik on Feb 14 2022, 12:00 PM.

Details

Diff Detail

Event Timeline

philnik created this revision.Feb 14 2022, 12:00 PM
philnik requested review of this revision.Feb 14 2022, 12:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 12:00 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Quuxplusone accepted this revision.Feb 21 2022, 1:31 PM

LGTM % comments!

libcxx/include/__algorithm/in_found_result.h
21

Same comment on the #if guard as in D119751.

libcxx/test/std/algorithms/algorithms.results/in_found_result.pass.cpp
55–56

Consider swapping these lines into the usual in, found order.

71–73

My usual comment here about [[maybe_unused]] being a code smell. Test that res2 got the right value.
Also, why static_cast? Shouldn't this just be

auto res2 = std::move(res);

?

75–77

Please use two different values here: int(true)==1 and bool(1)==true so this isn't testing anything. I suggest {2, false}.

This revision is now accepted and ready to land.Feb 21 2022, 1:31 PM
This revision was automatically updated to reflect the committed changes.
philnik marked 4 inline comments as done.