C++ Logo

std-discussion

Advanced search

Do char arrays provide storage only for implicitly created objects?

From: v.S. F. <de34_at_[hidden]>
Date: Fri, 5 Mar 2021 05:29:15 +0000
[intro.object]/3<https://eel.is/c++draft/intro.object#3> (added via P0137R1<https://wg21.link/p0137r1>) says that only arrays of unsigned char and arrays of std::byte provide storage for objects created within it (by placement new).

And the note<https://eel.is/c++draft/intro.object#note-4> for [intro.object]/13 (added via P0593R6<https://wg21.link/p0593r6>) says that in addition to these arrays, arrays of char also provide storage for implicitly created objects.

I think the status quo is inconsistent, and “array of N char” should also be present in [intro.object]/3.

(This is one of potential CWG issues for which I mailed to William M. Miller but have not been replied yet.)

Jiang An

Received on 2021-03-04 23:29:21