This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Adds back_insert_iterator::__get_container.
ClosedPublic

Authored by Mordante on Sep 27 2021, 11:56 AM.

Details

Summary

Adds a __get_container member as suggested by @Quuxplusone in D110497.

Includes s/_LIBCPP_INLINE_VISIBILITY/_LIBCPP_HIDE_FROM_ABI/.

Event Timeline

Mordante requested review of this revision.Sep 27 2021, 11:56 AM
Mordante created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2021, 11:56 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

Presumably you should wait to land this until it's actually needed by <format>, so we don't have a loose wire hanging around for too long without being hooked up to something.
The _LIBCPP_HIDE_FROM_ABI refactoring could just be landed ASAP, AFAIconcerned.

libcxx/include/__iterator/back_insert_iterator.h
59

Making the function a const member function has little use

Agreed, but it has non-negative use, and it's conventional (in that it doesn't modify any of *this's members), so I think you should make it const just for consistency.

Otherwise LGTM!

Mordante edited the summary of this revision. (Show Details)Sep 30 2021, 8:50 AM
Mordante updated this revision to Diff 376244.Sep 30 2021, 9:08 AM

Make the new member const.
Format the new unit test.

Mordante updated this revision to Diff 376247.Sep 30 2021, 9:24 AM

Rebased, hopefully fixes CI patch application.

ldionne accepted this revision.Apr 7 2022, 12:34 PM
ldionne added a subscriber: ldionne.

Let's rebase and ship this since <format> is about to need it.

This revision is now accepted and ready to land.Apr 7 2022, 12:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 7 2022, 12:34 PM
Mordante updated this revision to Diff 421320.Apr 7 2022, 12:56 PM

Rebase to trigger CI.

Mordante updated this revision to Diff 421334.Apr 7 2022, 1:41 PM

Rebase to trigger CI.

This revision was automatically updated to reflect the committed changes.