Title
Querying the alignment of an object
Status
nad
Section
7.6.2.6 [expr.alignof]
Submitter
Steve Clamage

Created on 2009-11-27.00:00:00 last changed 24 months ago

Messages

Date: 2022-04-15.00:00:00

Additional note (April, 2022)

This is a request for an extension, which is pursued by paper P2152 (Querying the alignment of an object).

Date: 2020-12-15.00:00:00

Additional note, April, 2020:

A survey of current implementations shows that most have already implemented the extension; the example there illustrates one motivation for its use. The principle of least astonishment would suggest that it is surprising for sizeof and alignof to behave differently in this regard.

Date: 2009-11-27.00:00:00

The current specification of the alignof operator (7.6.2.6 [expr.alignof]) allows it to be applied only to types, not to objects. Since the align attribute may be applied to objects, and since existing practice permits querying the alignment of objects, it should be considered whether to allow this in Standard C++ as well.

History
Date User Action Args
2022-11-23 23:04:06adminsetstatus: extension -> nad
2022-05-03 07:29:04adminsetmessages: + msg6824
2020-12-15 00:00:00adminsetmessages: + msg6317
2010-11-29 00:00:00adminsetstatus: open -> extension
2009-11-27 00:00:00admincreate