
22 Sep
2010
22 Sep
'10
7:43 p.m.
On Sep 22, 2010, at 2:46 PM, Mathias Gaunard wrote:
On 22/09/2010 18:35, Larry Evans wrote:
How would C++0x avoid the problem?
By allowing to put non-PODs in unions.
Could you point to the variant code violating this rule?
aligned_storage<whatever>::type is a POD type of a certain type T. In order to read and write any of the object a variant can hold, it will need to reinterpret cast from a pointer to that object to a pointer to any of these object types, that are not necessarily the same as T.
static_cast through void*, please. That has defined behavior, whereas reinterpret_cast is only implementation-defined. -- Dave Abrahams BoostPro Computing http://boostpro.com