# Standard library header <cstdalign> (C++11)(until C++20), <stdalign.h> (C++11)

> C++ Atlas: `cppatlas.com/w/cpp/header/cstdalign` | Source: https://en.cppreference.com/w/cpp/header/cstdalign | Domain: Standard headers | Standards: C++11

This header was originally in the C standard library as <stdalign.h>.

## Official Specification Summary (cppreference)

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): C compatibility macro constant, expands to integer literal `1` (macro constant)
- `__alignof_is_defined` (C++11): C compatibility macro constant, expands to integer literal `1` (macro constant)

### Notes

`<cstdalign>` is deprecated in C++17 and removed in C++20. Corresponding `<stdalign.h>` is still available in C++20.

### 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++ |

---
Attribution: content from https://en.cppreference.com/w/cpp/header/cstdalign (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.