I tried to make out the addition of TR1, known as aligned_storage. After reading the following documents N2165 , N3190 and N2140 I can’t see an expression in my life in which it clearly describes the structure of the stack or heap of memory used.
I looked at the implementation provided by msvc2010, boost, and gcc, all of which provide a stack based solution based on combining.
In short:
Is the type of memory (stack or heap) used by the aligned_storage implementation, or is it always intended for the stack?
and, What is a specific document that defines / defines this?
Note. In MSVC10, the following type definition is aligned_storage, in which case aligned_storage is an automatic variable, data is created on the stack (_Val, _Pad):
template<class _Ty, size_t _Len>
union _Align_type
{
_Ty _Val;
char _Pad[_Len];
};
Note. This is NOT a trivial question. Before sending an answer, try to understand this question.
Matthieu N.
source
share