Page MenuHomePhabricator

[libcxx] Implement std::to_address for C++20

Authored by glenjofe on Jul 16 2017, 6:46 PM.

Diff Detail

Event Timeline

glenjofe created this revision.Jul 16 2017, 6:46 PM
glenjofe created this object with edit policy "No One".
glenjofe changed the edit policy from "No One" to "All Users".
glenjofe updated this revision to Diff 106965.Jul 17 2017, 3:10 PM
glenjofe removed rL LLVM as the repository for this revision.

Include full context in the diff.

mclow.lists edited edge metadata.Aug 31 2017, 7:39 AM

This feature has not been added to the draft standard yet, so I'm reluctant to add it to libc++.

I appreciate the patch, and we may adopt it in the future, but not now.

glenjofe retitled this revision from [libcxx] Implement pointer_traits::to_address as in P0653R0 to [libcxx] Implement std::to_address for C++20.Nov 19 2017, 4:45 PM
glenjofe edited the summary of this revision. (Show Details)
glenjofe updated this revision to Diff 123520.Nov 19 2017, 4:48 PM

Now implements P0653R2 which was accepted in Albuquerque.

EricWF edited edge metadata.Nov 19 2017, 5:59 PM

Initially this LGTM. I'll take another pass in the morning.


Just make this unconditionally constexpr.


Could you add some tests that run at compile time using static_assert.

Also, could you verify the functions are correctly marked noexcept using ASSERT_NOEXCEPT from test_macros.h?

glenjofe updated this revision to Diff 123531.Nov 19 2017, 9:31 PM
glenjofe marked 2 inline comments as done.

Address Eric's review comments.

EricWF added inline comments.Nov 20 2017, 11:45 AM

Shouldn't one of these tests hit a non-noexcept function?

glenjofe added inline comments.Nov 20 2017, 1:48 PM

Both overloads of to_address are unconditionally noexcept.

glenjofe marked 2 inline comments as done.Nov 20 2017, 5:44 PM
EricWF accepted this revision.Nov 21 2017, 7:25 PM
This revision is now accepted and ready to land.Nov 21 2017, 7:25 PM

Thanks Eric. Can you commit on my behalf?

EricWF closed this revision.Nov 22 2017, 11:49 AM