STD::ALIGNED_STORAGE(3cxx)

🌸 NAME 🌸

okay so bestie, this is the 3cxx manual page for std::aligned_storage< _Len, _Align > — and the official name line is literally: Alignment type. slay. 💅

✨ SYNOPSIS ✨

the whole include situation is:

#include <type_traits>

💫 Detailed Description 💫

here’s the template signature, copied exactly so we don’t mess with the magic:

template<std::size_t _Len, std::size_t _Align = __alignof__(typename
       __aligned_storage_msa<_Len>::__type)>
       struct std::aligned_storage< _Len, _Align >

so std::aligned_storage< _Len, _Align > is the alignment type, periodt. ✨

the tea on _Align: its value is a default-alignment which shall be the most stringent alignment requirement for any C++ object type whose size is no greater than _Len (3.9). not me citing the section number, iykyk. 📚

and the member typedef type shall be a POD type suitable for use as uninitialized storage for any object whose size is at most _Len and whose alignment is a divisor of _Align. that’s the whole vibe check, fr fr. 🫶

🚨 Deprecated 🚨

Deprecated in C++23. uses can be replaced by an array std::byte[_Len] declared with alignas(_Align). so the replacement path is right there, bestie — this one’s giving legacy era. 💀

🫶 Author 🫶

the page says: Generated automatically by Doxygen for libstdc++ from the source code. so yes, our girl was auto-generated by Doxygen for libstdc++, and she ate. 👑


and that’s the whole page, bestie 💖 source/version: libstdc++, section 3cxx; date: not printed on the page, so i’m not gonna invent one — we keep the facts cute and correct. mwah 🎀✨