Page MenuHomePhabricator

Prototype implementation of P1004R2 (making std::vector constexpr).
Needs ReviewPublic

Authored by ldionne on Oct 2 2019, 5:42 PM.


Group Reviewers
Restricted Project

This is the prototype implementation that I was using to test the compiler-side
support for P0784R7. I'm hoping someone else will either pick this up and
finish it, or use it as inspiration for a real implementation of the library
side of P1004R2 in libc++.

Depends on D68364.

Diff Detail

Event Timeline

rsmith created this revision.Oct 2 2019, 5:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 2 2019, 5:42 PM
Herald added a subscriber: christof. · View Herald Transcript
rsmith updated this revision to Diff 222945.Oct 2 2019, 5:48 PM

Move some changes from here to the std::allocator change.

ldionne added a subscriber: ldionne.Oct 3 2019, 7:24 AM

I'll pick this up. I wasn't aware you had started working on this, but thanks!

ldionne commandeered this revision.Oct 3 2019, 7:44 AM
ldionne added a reviewer: rsmith.
ldionne updated this revision to Diff 302609.Nov 3 2020, 10:13 AM

I've had a revision locally for a long long time. It doesn't pass everything
yet, but I've managed to get it down to ~10 failing tests with a few more hacks

Herald added a reviewer: Restricted Project. · View Herald TranscriptNov 3 2020, 10:13 AM
miscco added a subscriber: miscco.Nov 3 2020, 11:14 AM

Some quick review of the the acutal changes to the headers


I am wondering whether we should reuse the simplementation of std::copy_n here (or at the call site for what its worth)


As said above, we should be able to reuse the internals of std::copy_n here


From here and below there is _LIBCPP_CONSTEXPR_AFTER_CXX11 rather than _LIBCPP_CONSTEXPR_AFTER_CXX17

Also the ordering of _LIBCPP_INLINE_VISIBILITY and _LIBCPP_CONSTEXPR_AFTER_CXX11 is swapped.


I believe the inline is superfluous with the _LIBCPP_CONSTEXPR_AFTER_CXX17

Appears throughout


Many inline below here