Boost logo

Boost :

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

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


>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;
>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

Bill Kempf

MSN Photos is the easiest way to share and print your photos:

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