9 Feb
2016
9 Feb
'16
2:02 p.m.
// do something that allocates from the heap
v.emplace_back( new X );
The last line constructs a block_ptr<X> inside the vector's allocated memory, which is on the heap. So the block_ptr goes looking for a previous heap allocation and finds some random one.
Ah wait, the last allocation is "new X" here. Hmm.