On 07/02/2014 01:18 PM, Jan Hubicka wrote:
We propagate types from places we know instances are created across pointers
passed to functions.  Once non-POD type is created at a given memory location,
one can not change its type by placement_new into something else.

Hmm. If the memory location is untyped (i.e. from malloc) or a character array, or a union, you can indeed destroy an object of one type and create an object of a different type in that location.

Jason, this assumes that one can not destroy the type and re-construct same
type at the same spot.

That is an invalid assumption; you can destroy one object and construct a new one in the same location. Doing it within a method would be unusual, but I don't think there's a rule against it.

Jason

Reply via email to