Page MenuHomePhabricator

[libc++] Adds back_insert_iterator::__get_container.
Needs ReviewPublic

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

Details

Reviewers
Quuxplusone
Group Reviewers
Restricted Project
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
Quuxplusone accepted this revision as: Quuxplusone.Sep 28 2021, 11:56 AM

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.