Boost logo

Boost :

From: Eyal Farago (eyalfa_at_[hidden])
Date: 2002-04-09 12:41:42

1. What do you mean by intrusive/non intrusive pointer?
2. I believe that holding a pointer map whose key is as raw void*
pointer won't solve the problem.
Consider the case of multiple inheritance:
        class c : public a , public b {...};

if cc is an instance of c, the following does not always compare equal:

(c*)(&cc) , (a*)(&cc) , (b*)(&cc).

casting any of these result into a void and using it as a key to the map
is dangerous since the same object might be registered twice...


-----Original Message-----
From: Peter Dimov [mailto:pdimov_at_[hidden]]
Sent: Tuesday, April 09, 2002 5:55 PM
To: boost_at_[hidden]
Subject: Re: [boost] smart pointer puzzle

From: "Eyal Farago" <eyalfa_at_[hidden]>
> How did it solve the 'smart_ptr to this' problem?
> It seems to me like a Fundamental problem when using smart pointers.

It is only a problem with non-intrusive implementations, like
boost::shared_ptr. I don't particularly like the global pointer map

Intrusive implementations convert between raw and smart with ease.

FWIW, I have encountered the 'this' problem myself - once; I used a
intrusive pointer to solve it. In all other cases I still use

Unsubscribe & other changes:

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