I've been trying to get my head around the TR1 addition known as aligned_storage. Whilst reading the following documents N2165, N3190 and N2140 I can't for the life of me see a statement where it clearly describes stack or heap nature of the memory being used.
I've had a look at the implementation provided by msvc2010, boost and gcc they all provide a stack based solution centered around the use of a union.
In short:
Is the memory type (stack or heap) used by aligned_storage implementation defined or is it always meant to be stack based?
and, What the is the specific document that defines/determines that?
Note: In MSVC10, the following is the definition of the type of aligned_storage, in this case if the aligned_storage is an auto variable the data(_Val,_Pad) is created on the stack:
template<class _Ty, size_t _Len>
union _Align_type
{
// union with size _Len bytes and alignment of _Ty
_Ty _Val;
char _Pad[_Len];
};
Note: This is NOT a trivial question. Please try and understand the question before posting an answer.