This is an archive of the discontinued LLVM Phabricator instance.

[libc++][ranges][NFC] Test that range algorithms support iterators requiring `iter_move`.
ClosedPublic

Authored by var-const on Jul 18 2022, 8:24 PM.

Diff Detail

Event Timeline

var-const created this revision.Jul 18 2022, 8:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2022, 8:24 PM
var-const requested review of this revision.Jul 18 2022, 8:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2022, 8:24 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
huixie90 accepted this revision.Jul 19 2022, 3:09 AM
huixie90 added a subscriber: huixie90.
huixie90 added inline comments.
libcxx/test/std/algorithms/ranges_robust_against_proxy_iterators.pass.cpp
119

binary_func seem to return bool and transform would write these bools to the output. I guess it works for the int overload because bool is convertible to int. But for MoveOnly overload, it probably doesn't work.

var-const updated this revision to Diff 445860.Jul 19 2022, 9:55 AM

Address feedback

var-const marked an inline comment as done.Jul 19 2022, 9:59 AM
ldionne accepted this revision.Jul 19 2022, 1:43 PM
ldionne added a subscriber: ldionne.

I'm happy with this approach (using a template and if constexpr to opt-out a few checks). However, if we end up having to add a lot more if constexpr, I would strongly consider copy-pasting the function instead to avoid adding too much logic in the tests. For the sake of keeping tests easy to validate.

This revision is now accepted and ready to land.Jul 19 2022, 1:43 PM