https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120397

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2025-05-22
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
When the type has a non-trivial default constructor then uninitialized_default
has the same problem:

#include <memory>

struct X { X() { } ~X() { } };

void val(X (*x)[1])
{
  std::uninitialized_value_construct(x, x+1);
}
void val_n(X (*x)[1])
{
  std::uninitialized_value_construct_n(x, 1);
}
void def(X (*x)[1])
{
  std::uninitialized_default_construct(x, x+1);
}
void def_n(X (*x)[1])
{
  std::uninitialized_default_construct_n(x, 1);
}

I don't think any of the other std::uninitialized_xxx algos in C++17 can be
used to create arrays, so it's only these ones.

Reply via email to