This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][nfc] moves std `advance`, `next`, and `prev` into their headers
ClosedPublic

Authored by cjdb on May 28 2021, 10:56 AM.

Diff Detail

Event Timeline

cjdb requested review of this revision.May 28 2021, 10:56 AM
cjdb created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2021, 10:56 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.May 31 2021, 8:03 AM

I'm not a big fan of putting std::advance and std::ranges::advance in the same header - they are related but at the same time, they are fundamentally different things and have different dependencies. That's one reason why I preferred to split ranges:: things into <__ranges/XXXX.h> instead. But I guess this will do, we can adjust in the future if need be.

This revision is now accepted and ready to land.May 31 2021, 8:03 AM
cjdb added a comment.May 31 2021, 10:01 AM

I'm not a big fan of putting std::advance and std::ranges::advance in the same header - they are related but at the same time, they are fundamentally different things and have different dependencies. That's one reason why I preferred to split ranges:: things into <__ranges/XXXX.h> instead. But I guess this will do, we can adjust in the future if need be.

Whatever we decide, it's better to keep <iterator> things inside __iterator/ wherever possible (i.e. we should probably do <__iterator/ranges/XXXX.h>, not <__ranges/XXXX.h>).