Given alignment and size of an otherwise unknown type, how can one safely construct free storage (heap) that is properly aligned?
For context: The automatic storage version is well documented. See the example at https://en.cppreference.com/w/cpp/types/aligned_storage: An opaque uninitialized storage on stack gets properly aligned, which can later be placement new'ed once type is known.
Is it possible to similarly do alignment-safe uninitialized allocation on the heap? This storage would later get placement-new initialized once the type is known (and deleted in type-aware context with proper destruction etc.)
The following naïve attempt fails: https://godbolt.org/z/PM1xWoYox
What is the mental model here with heap storage?