You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An object of array type contains a contiguously allocated non-empty set of N subobjects of type T.
By reading the specification, it is not clear that whether an array object is allowed to have padding bytes (memory not overlapped with array elements) in the front or at the end. I also failed to figure it out by finding the rules directly concerned with objects and object types elsewhere. Eventually I believe it is not true because [expr.sizeof]/2 tells me:
When applied to an array, the result is the total number of bytes in the array. This implies that the size of an array of n elements is n times the size of an element.
However, this is too subtle.
In contrast, wording in ISO C seems better in this sense:
WG14/N1570
6.2.5
— An array type describes a contiguously allocated nonempty set of objects with a
particular member object type, called the element type.
So can the wording in C++ standard be improved to make the intent more explicit?
The text was updated successfully, but these errors were encountered:
WG21/N4567
[dcl.array]/1
By reading the specification, it is not clear that whether an array object is allowed to have padding bytes (memory not overlapped with array elements) in the front or at the end. I also failed to figure it out by finding the rules directly concerned with objects and object types elsewhere. Eventually I believe it is not true because [expr.sizeof]/2 tells me:
However, this is too subtle.
In contrast, wording in ISO C seems better in this sense:
WG14/N1570
6.2.5
So can the wording in C++ standard be improved to make the intent more explicit?
The text was updated successfully, but these errors were encountered: