shared_ptr and address_of

Is there any reason address_of is not defined for shared_ptr, scoped_ptr etc.? Thanks -Thorsten -- Thorsten Ottosen ---------------------------- www.dezide.com www.cs.aau.dk/index2.php?content=Research/bss www.boost.org www.open-std.org/JTC1/SC22/WG21/

Thorsten Ottosen wrote:
Is there any reason address_of is not defined for shared_ptr, scoped_ptr etc.?
I've no idea what you mean, sorry. addressof(x) is an alias for &x that works in the presence of overloaded operator& and is defined for every object type. It should probably also support function types, but the current implementation does not.

"Peter Dimov" <pdimov@mmltd.net> wrote in message news:003e01c52d52$42ddfda0$6501a8c0@pdimov2... | Thorsten Ottosen wrote: | > Is there any reason address_of is not defined for shared_ptr, | > scoped_ptr etc.? | | I've no idea what you mean, sorry. well, currently I have to do T* = &*ptr; to get the address. I haven't yet convinced me if I need it ot not so I can cast from void* to T*. Anyway, thanks. -Thorsten

Thorsten Ottosen wrote:
"Peter Dimov" <pdimov@mmltd.net> wrote in message news:003e01c52d52$42ddfda0$6501a8c0@pdimov2...
Thorsten Ottosen wrote:
Is there any reason address_of is not defined for shared_ptr, scoped_ptr etc.?
I've no idea what you mean, sorry.
well, currently I have to do
T* = &*ptr;
to get the address.
#include <boost/get_pointer.hpp> void f( Sp ps ) { using boost::get_pointer; typename pointee<Sp>::type * pt = get_pointer( ps ); } HTH
participants (2)
-
Peter Dimov
-
Thorsten Ottosen