$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-07-17 04:25:52
Mathias Gaunard skrev:
> Howard Hinnant wrote:
>
>> The difference here is subtle, and some may even say insignificant.
>> Others will say very significant. If the client of A also has a client
>> C that uses the smart_ptr of A then the closer you can come to a "common
>> well known type" the better. shared_ptr<B> is better known than
>> unique_ptr<B, void(*)(B*)> or A::handle.
>
> It's only a matter of name.
> A template typedef is sufficient to get a better name.
>
> template<typename T>
> struct dynamic_unique_ptr : unique_ptr<T, void(*)(T*)>
> {
> };
It is more than a name. The dynamic deleter gives you the possibility to
binary stable interfaces and let the implementation vary over time as
you like. In the API I wrote a year ago, we used shared_ptr for exactly
this purpose.
-Thorsten