
26 May
2007
26 May
'07
3:21 a.m.
On 5/23/07, Peter Dimov <pdimov@mmltd.net> wrote:
[snip]
struct Base { virtual ~Base() {} };
struct Derived: Base { int i; };
Derived * pd = new Derived; Base * pb = pd; shared_ptr<void> pv( pb );
[snip]
or
pv->pointer() == pd && pv->type() == typeid(Derived);
Sorry if it is too obvious. But how can shared_ptr implement pv->pointer() == pd ? It takes pb from the constructor, it doesnt know anything about Derived.
[snip]
Thanks, -- Felipe Magno de Almeida