10 Jun
2014
10 Jun
'14
11:36 a.m.
Glen Fernandes wrote:
I was under the impression that only complete types were required (i.e. only what you can use with alignof).
Yes, but T[] is an exception. 5.3.6 Alignof [expr.alignof] 1 An alignof expression yields the alignment requirement of its operand type. The operand shall be a type-id representing a complete object type or an array thereof or a reference to a complete object type. 2 The result is an integral constant of type std::size_t. 3 When alignof is applied to a reference type, the result shall be the alignment of the referenced type. When alignof is applied to an array type, the result shall be the alignment of the element type. When T is a complete object type, T[] is an array thereof, so it's allowed. I think.