Boost logo

Boost :

Subject: Re: [boost] [shared_ptr] A smarter smart pointer proposal for dynamic libraries
From: J.D. Herron (jotadehace_at_[hidden])
Date: 2008-12-25 06:06:13

>> Yes that's the point, its inlined wherever the shared pointer template is
>> instantiated for the type. Being a template it has to work that way.

>Actually not. Some compilers do link-time instantiation.

My reply was poorly worded. Of course the compiler may choose to generate
function calls for an instantiated type and could do so for both the
executable and dynamically loaded dll in my simple example. Fine. My point
is that even if that were the case it doesn't hurt my simple smart pointer
alternative because the function pointers that might exist in the factory
are not carried over into the executable and therefore would pose no
problem The only way function pointers could be carried over would be via a
VTABLE which does not exist here. So, if the compiler chose to create a
function call rather that straight inlining it still works because in the
exe it calls the exe created function which does the right thing. There is
no call back into the dynamic dll function as would be the case for a
generated VTABLE.

I will have to think some more on the claims that there is no way to support
custom allocators and deleters without a VTABLE. I agree completely that
these are essential features. Need to learn some more on how exactly these
are implemented and why a VTABLE would be essential.

Boost list run by bdawes at, gregod at, cpdaniel at, john at