Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-11-18 07:56:46

From: "David Abrahams" <dave_at_[hidden]>

[ about get_deleter<D> vs map<weak_ptr<void>, PyObject*> ]

> I first considered that approach shortly after Boost.Python v1 came
> out, back in... well, it was several years ago. It's never been a
> price I was willing to force on users. The picture hasn't changed
> much, except that now I know I'm going to make deleters which hold
> exactly the data I want.
> I think I'd probably hack up a specialized shared_ptr<APrivateClass>
> so that I could take advantage of the friend declarations in the
> implementation before I'd use a map-based solution.
> I realize my case is somewhat unusual. I can't really argue that it
> warrants publicizing deleter introspection for everybody... however,
> since we're all part of a big happy Boost family and I /could/ always
> switch to a map if the shared_ptr implementation changes, how bad
> would it be for me to use my hack?

There isn't anything bad. What I really ask is your opinion on whether
get_deleter<> should be proposed for the TR, i.e. whether the technique of
storing private data in shared_ptr deleters and then getting it back when
you happen to encounter one of your shared_ptrs is of general utility,
considering that a general alternative (map<weak_ptr<void>, Data>) exists.

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