Boost logo

Boost :

Subject: Re: [boost] [Modularization] new Memory module
From: Peter Dimov (lists_at_[hidden])
Date: 2014-06-10 07:36:18


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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk