[libcxx-commits] [PATCH] D69882: [libcxx] Implement P0325: to_array from LFTS with updates.
Zoe Carver via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Nov 6 08:54:29 PST 2019
zoecarver added a comment.
Thanks for the patch @curdeius! It looks great.
I also have an implementation here, D66103 <https://reviews.llvm.org/D66103>. We can use either (and maybe both sets of tests).
================
Comment at: libcxx/include/array:501
+ is_nothrow_constructible_v<
+ _Tp, _Tp&>) // FIXME: Standard does not say anything about noexcept.
+{
----------------
I don't think you need the noexcept.
================
Comment at: libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp:14
+#include <cassert>
+#include <cstddef>
+
----------------
Is this needed?
================
Comment at: libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp:25
+ {
+ struct move_only {
+ constexpr move_only(int i = 0) : i(i) {}
----------------
You can get this with `#include "MoveOnly.h"`.
================
Comment at: libcxx/test/std/containers/sequences/array/array.creation/to_array.pass.cpp:22
+ auto arr = std::to_array({1, 2, 3});
+ static_assert(std::is_same_v<decltype(arr), std::array<int, 3> >, "");
+ assert(arr[0] == 1);
----------------
You can use `ASSERT_SAME_TYPE` (from `test_macros`).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69882/new/
https://reviews.llvm.org/D69882
More information about the libcxx-commits
mailing list