This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Move __libcpp_erase_if_container into <iterator>, and ADL-proof it
ClosedPublic

Authored by Quuxplusone on Mar 21 2021, 2:30 PM.

Details

Summary

The container headers don't need to include <functional> for any other reason (or at least, they wouldn't if we moved less and equal_to out of <functional>), so let's put __libcpp_erase_if_container somewhere that's common to the containers but outside of <functional>.

Also, calling std::erase_if(c, pred) should not trigger ADL.

Diff Detail

Event Timeline

Quuxplusone requested review of this revision.Mar 21 2021, 2:30 PM
Quuxplusone created this revision.
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptMar 21 2021, 2:30 PM
curdeius accepted this revision as: curdeius.Mar 22 2021, 1:06 AM

LGTM. I remember having raised the question of moving this function some time ago, what you did is exactly what I wanted.
Don't you want to add some ADL-robustness tests? 😁

ldionne accepted this revision.Mar 22 2021, 6:14 AM
This revision is now accepted and ready to land.Mar 22 2021, 6:14 AM