Does sizeof(T) == sizeof(const T) and alignof(T) == alignof(const T)

Section 3.9.3:

The cv-qualified or cv-unqualified versions of a type are distinct
types; however, they shall have the same representation and alignment
requirements (3.11). 53

“cv-qualified” here refers to const and volatile. So the answer is, yes.

const and volatile only specify the limitations/attributes of access to the specified object. They are not considered to be a part of the base type itself; hence they cannot affect the type’s properties.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)