Boost logo

Boost :

Subject: Re: [boost] [shifted_ptr] Review Request
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-04-06 14:07:07


AMDG

On 04/06/2011 10:54 AM, Nevin Liber wrote:
> 2011/4/6 Юрій Зубрицький<mt.wizard_at_[hidden]>
>
>> Actually, boost::make_shared involves one dynamic_cast operation (when
>> getting deleter from shared_ptr object), that's why it doesn't perform
>> faster at all
>>
>
> Where exactly is that in the code? I don't see it in make_shared.hpp
> (1.46.1), and the uses inside shared_ptr.hpp look to be related to
> construction and dynamic_pointer_cast.
>

I assume that he's referring to the call to get_deleter.
It doesn't actually do a dynamic_cast. It
does a single type_info comparison.

> I also surmise that dynamic_cast is still faster than heap allocation.

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk