[libcxx-commits] [libcxx] [libc++] Implement P3508R0: Wording for "constexpr for specialized memory algorithms" (PR #197313)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Sun May 24 16:37:45 PDT 2026
================
@@ -48,6 +50,23 @@ struct Nasty
int Nasty::counter_ = 0;
+TEST_CONSTEXPR_CXX26 bool test() {
+ const int n = 3;
+ const ConstCopy in[n] = {ConstCopy(1), ConstCopy(2), ConstCopy(3)};
+ std::allocator<ConstCopy> alloc;
+ ConstCopy* out = alloc.allocate(n);
+
+ ConstCopy* result = std::uninitialized_copy(in, in + n, out);
+ assert(result == out + n);
+ for (int i = 0; i != n; ++i)
+ assert(out[i].val == in[i].val);
+
+ backport::destroy(out, out + n);
----------------
frederick-vs-ja wrote:
```suggestion
util::destroy(out, out + n);
```
Same for some other test files.
https://github.com/llvm/llvm-project/pull/197313
More information about the libcxx-commits
mailing list