[libcxx-commits] [PATCH] D69134: [libc++][P0784] Added construct_at and marked destroy_at/destroy/destroy_n constexpr.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Nov 13 08:18:12 PST 2019


ldionne requested changes to this revision.
ldionne added inline comments.
This revision now requires changes to proceed.


================
Comment at: libcxx/test/std/utilities/memory/specialized.algorithms/specialized.construct/construct_at.pass.cpp:24
+  int& count_;
+  TEST_CONSTEXPR_DYNAMIC_ALLOC Counted(int& count) : count_(count) { ++count; }
+  TEST_CONSTEXPR_DYNAMIC_ALLOC Counted(Counted const& that) : count_(that.count_) { ++count_; }
----------------
Those can be `constexpr` unconditionally.


================
Comment at: libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy.pass.cpp:25
+  int& count_;
+  TEST_CONSTEXPR_DYNAMIC_ALLOC Counted(int& count) : count_(count) { ++count; }
+  TEST_CONSTEXPR_DYNAMIC_ALLOC Counted(Counted const& that) : count_(that.count_) { ++count_; }
----------------
Same, `constexpr` unconditionally.


================
Comment at: libcxx/test/std/utilities/memory/specialized.algorithms/specialized.destroy/destroy_at.pass.cpp:54
+#if TEST_STD_VER > 17
+    Counted* ptr1 = std::construct_at(mem1, count);
+    Counted* ptr2 = std::construct_at(mem2, count);
----------------
Jeez, what a pain. Should we consider supporting `construct_at` in C++17 as an extension?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69134/new/

https://reviews.llvm.org/D69134





More information about the libcxx-commits mailing list