
24 Oct
2012
24 Oct
'12
12:14 p.m.
On 24/10/12 13:21, David Hagood wrote:
On 10/23/2012 09:16 PM, TONGARI wrote:
Just provide it with your custom Deleter in the ctor.
template<class Y, class D> shared_ptr(Y * p, D d); OK, thanks.
However - this does require every construction of a shared pointer to be passed that destructor - that seems error prone if it is known that all T must be released by a given call.
1) your library will be the one creating the shared_ptr, so this wouldn't affect users 2) If the deleter is not passed to the constructor, it will be default-constructed, which is enough for your needs.