Boost logo

Boost :

From: William Kempf (williamkempf_at_[hidden])
Date: 2002-06-22 16:42:34


>From: "Jaap Suter" <J.Suter_at_[hidden]>

[snip]

>Obviously I need to resolve this conflict. So what I've done is implemented
>a raw_ptr class that implements the .get() method so that it is compatible
>with the shared_ptr and scoped_ptr. So now the line that used to be:
>
>if ( t_OwnerShipPolicy == RAW ) typedef Node* NodePtr;
>
>becomes:
>
>if ( t_OwnerShipPolicy == RAW ) typedef raw_ptr< Node > NodePtr;

Another option is to provide a standalone templated get_raw_ptr() method
that's specialized to just return the pointer if it's not a smart pointer
and return get() otherwise. Then anywhere in your implementation where you
call p.get() you instead call get_raw_ptr(p).

This would probably be simpler then implementing a full raw_ptr smart
pointer.

Bill Kempf
williamkempf_at_[hidden]

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk