This is an archive of the discontinued LLVM Phabricator instance.

implement std::to_array (P0325R3)
AbandonedPublic

Authored by zoecarver on Aug 12 2019, 12:25 PM.

Details

Summary

This patch implements std::to_array based on P0325R3.

Event Timeline

zoecarver created this revision.Aug 12 2019, 12:25 PM
mclow.lists requested changes to this revision.Sep 12 2019, 8:17 AM
mclow.lists added inline comments.
libcxx/include/array
500

Why is_constructible<_Tp, _Tp&>? - this seems wrong.
At the very least, the second one should be const T&.
But even better would be is_copy_constructible<_Tp> - because that's what you're going to do.

510

You can use the _v versions here; this is C++20

libcxx/test/std/containers/sequences/array/array.creation/to_array.pass.cpp
21

We have a nice move-only type in "MoveOnly.h".
Is there some reason why you didn't want to use that?

This revision now requires changes to proceed.Sep 12 2019, 8:17 AM
zoecarver updated this revision to Diff 219942.Sep 12 2019, 9:46 AM
  • update tests
  • add copy only support class
  • fix based on review
Herald added a project: Restricted Project. · View Herald TranscriptSep 12 2019, 9:46 AM
zoecarver abandoned this revision.EditedNov 7 2019, 8:22 AM

Abandoning in favor of D69882.

Edit: I'll add CopyOnly.h in a different patch.