Difference between revisions of "cpp/header/cstdalign"
From cppreference.com
(Added the description of __alignof_is_defined.) |
|||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | {{cpp/header/title|cstdalign|stdalign.h}} | + | {{cpp/header/title|cstdalign|stdalign.h|notes={{mark c++11}}{{mark until c++20}}|notes2={{mark c++11}}}} |
{{cpp/header/navbar}} | {{cpp/header/navbar}} | ||
{{cpp/header/c}} | {{cpp/header/c}} | ||
− | C compatibility header. | + | C compatibility header. {{c/core|alignas}} and {{c/core|alignof}} are [[cpp/keyword|keywords]] in C++, but they were not keywords in C until C23. |
{{dsc begin}} | {{dsc begin}} | ||
− | {{dsc h1 | Macros}} | + | {{dsc h1|Macros}} |
− | {{dsc inc | cpp/types/dsc alignas_is_defined}} | + | {{dsc inc|cpp/types/dsc alignas_is_defined}} |
+ | {{dsc inc|cpp/types/dsc alignof_is_defined}} | ||
{{dsc end}} | {{dsc end}} | ||
===Notes=== | ===Notes=== | ||
− | {{tt|<cstdalign>}} is deprecated in C++17 and removed in C++20. Corresponding {{ | + | {{tt|<cstdalign>}} is deprecated in C++17 and removed in C++20. Corresponding {{header|stdalign.h|lang=c}} is still available in C++20. |
+ | |||
+ | ===Defect reports=== | ||
+ | {{dr list begin}} | ||
+ | {{dr list item|wg=lwg|dr=3827|std=C++11|before=C programs no longer need the compatibility<br>macro {{tt|__alignas_is_defined}} since C23|after=deprecated this<br>macro in C++}} | ||
+ | {{dr list end}} | ||
{{langlinks|de|es|ja|ru|zh}} | {{langlinks|de|es|ja|ru|zh}} |
Latest revision as of 21:42, 16 July 2024
This header was originally in the C standard library as <stdalign.h>.
C compatibility header. alignas and alignof are keywords in C++, but they were not keywords in C until C23.
Macros | |
__alignas_is_defined (C++11)(deprecated) |
C compatibility macro constant, expands to integer literal 1 (macro constant) |
__alignof_is_defined (C++11)(deprecated) |
C compatibility macro constant, expands to integer literal 1 (macro constant) |
[edit] Notes
<cstdalign>
is deprecated in C++17 and removed in C++20. Corresponding <stdalign.h> is still available in C++20.
[edit] Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 3827 | C++11 | C programs no longer need the compatibility macro __alignas_is_defined since C23
|
deprecated this macro in C++ |