3 ms·
I imagine C++ doesn't allow FAMs because it wouldn't know how to call the destructors/constructors on the members of the array (or how many to call).
by yoklov 11y ago
I imagine C++ doesn't allow FAMs because it wouldn't know how to call the destructors/constructors on the members of the array (or how many to call).
- uxcn 11y agoTo allow FAMs for non-trivially constructible/destructible types would be slightly more complicated than C FAMs, but it doesn't seem like an unreasonable thing to expect from the language/library, or intractable from a standard or compiler perspective. Regardless, I'm still not sure what the justification is requiring it be UB even for just primitive types.