[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
Tue Nov 5 05:51:23 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:32
+    std::allocator<Counted> a;
+    Counted* p = a.allocate(2);
+    int count = 0;
----------------
Can you add a test trying to call `construct_at` on a pointer-to-const? Apparently, the intent is that `construct_at` can be called on a pointer-to-const pointing to a location of memory that hasn't been initialized yet.

The idea is that `const` only applies to objects that whose lifetime has begun, so the pointer-to-const doesn't point to a const object yet (well, not until you've in-place-newed it).


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