
23 Sep
2011
23 Sep
'11
12:03 p.m.
On 23.09.2011 13:43, Olaf van der Spek wrote:
Hi,
I was wondering why shared_ptr/array include both a ptr to the control block and a ptr to the data (ptr) in the class itself. I assume it's for performance reasons, but I didn't find anything about that in the docs.
It's for aliasing. You can have a shared_ptr that points to a subobject of the object controlled by the control block. Sebastian