This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Use the same implementation of invoke for C++03 and C++11
ClosedPublic

Authored by philnik on Jun 10 2022, 4:38 AM.

Diff Detail

Event Timeline

philnik created this revision.Jun 10 2022, 4:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2022, 4:38 AM
philnik requested review of this revision.Jun 10 2022, 4:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2022, 4:38 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Jun 10 2022, 8:49 AM

The price to pay is a decrease in legibility of the main implementation of std::__invoke, however the benefit is really worth it IMO, so I'm happy with this.

Can you please check whether we have tests that could be expanded in C++03 now? I seem to recall seeing tests for invoke that wouldn't go beyond 3 arguments in C++03 mode or something like that, and they could be updated. The same should apply to mem_fn and reference_wrapper.

This revision is now accepted and ready to land.Jun 10 2022, 8:49 AM
EricWF added a subscriber: EricWF.Jun 10 2022, 3:03 PM

I remember the last time I tried to do this, it broke a bunch of things. I can't remember why -- but it did.

Shouldn't this change turn on more tests in C++03?

Shouldn't this change turn on more tests in C++03?

Which ones? I couldn't find any when looking.

Shouldn't this change turn on more tests in C++03?

Which ones? I couldn't find any when looking.

All of the ones that run in C++11 if possible?