Preliminary discussion on the reflector has demonstrated some concerns about the direction proposed in this paper. Notwithstanding, I believe the remaining use (but not the definition, if required for the library section) of POD in the core language section is misleading at best and should be fixed.
Before the lifetime of an object has started but after the storage which the object will occupy has been allocated [ Footnote: For example, before the construction of a global objectRemove in 6.9 [basic.types] paragraph 9:of non-POD class typethat is initialized via a user-provided constructor (15.7 [class.cdtor]). ] or, after the lifetime of an object has ended and before the storage which the object occupied is reused or released, any pointer that represents the address of the storage location where the object will be or was located may be used but only in limited ways. [...]
[...]Change in 8.1.5.1 [expr.prim.lambda.closure] paragraph 2:Scalar types, POD classes (Clause 12), arrays of such types and cv-qualified versions of these types are collectively called POD types.[...]
An implementation may define the closure type differently from what is described below provided this does not alter the observable behavior of the program other than by changing:Remove the normative text in 12 [class] paragraph 10, but keep the example:
- the size and/or alignment of the closure type,
- whether the closure type is trivially copyable (Clause 12), or
- whether the closure type is a standard-layout class (Clause 12)
, or.whether the closure type is a POD class (Clause 12).
Change in 20.3.3 [defns.character.container]:A POD struct [ Footnote: ...] is a non-union class that is both a trivial class and a standard-layout class, and has no non-static data members of type non-POD struct, non-POD union (or array of such types). Similarly, a POD union is a union that is both a trivial class and a standard-layout class, and has no non-static data members of type non-POD struct, non-POD union (or array of such types). A POD class is a class that is either a POD struct or a POD union.[ Example:struct N { // neither trivial nor standard-layout int i; int j; virtual ~N(); }; struct T { // trivial but not standard-layout int i; private: int j; }; struct SL { // standard-layout but not trivial int i; int j; ~SL(); }; struct POD { // both trivial and standard-layout int i; int j; };-- end example ]
character container typeChange in 21.2.4 [support.types.layout] paragraph 5:
a class or a type used to represent a character [ Note: It is used for one of the template parameters of the string, iostream, and regular expression class templates.A character container type is a POD (6.9) type.-- end note ]
The typeChange in 23.15.2 [meta.type.synop]max_align_t
is aPODtrivial type whose alignment requirement is at least as great as that of every scalartype, and whose alignment requirement is supported in every context (6.11 [basic.align]).
In the table in 23.15.4.3 [meta.unary.prop], strike the row fortemplate <class T> struct is_pod;[...]template <class T> inline constexpr bool is_pod_v = is_pod<T>::value;
is_pod
:
Change in the table in 23.15.7.6 [meta.trans.other]:template <class T> struct is_pod;
T is a POD type (6.9 [basic.types])
remove_all_extents_t<T>
shall be a complete type or cv void.
Change in 24.1 [strings.general] paragraph 1:aligned_storage
The member typedef type shall be aPODtrivial type suitable for use as uninitialized storage for any object whose size is at mostLen
and whose alignment is a divisor ofAlign
.
aligned_union
The member typedef type shall be aPODtrivial type suitable for use as uninitialized storage for any object whose type is listed inTypes
; its size shall be at leastLen
.
This Clause describes components for manipulating sequences of any non-arrayAdd a new subsection to Annex D or merge into D.12 [depr.meta.types]:PODtrivial (6.9 [basic.types]) type. Such types are called char-like types, and objects of char-like types are called char-like objects or simply characters.
D.17 Identification of POD types [depr.is_pod]The following type property is defined in header
<type_traits>
in addition those defined in 23.15.4.3 [meta.unary.prop]:template <class T> struct is_pod; template <class T> inline constexpr bool is_pod_v = is_pod<T>::value;Requires:remove_all_extents_t<T>
shall be a complete type or cvvoid
.
is_pod<T>
is a UnaryTypeTrait (23.15.1 [meta.rqmts]) with a base characteristic oftrue_type
if T is a POD type, andfalse_type
otherwise. A POD class is a class that is both a trivial class and a standard-layout class, and has no non-static data members of type non-POD class (or array thereof). A POD type is a scalar type, a POD class, an array of such a type, or a cv-qualified version of one of these types. [ Note: It is unspecified whether a closure type (8.1.5.1 [expr.prim.lambda.closure]) is a POD type. -- end note ]