From: Marcus L. <ma...@ya...> - 2009-03-16 16:10:54
|
Dirk Reiners wrote: > Marcus Lindblom wrote: > >> Allen Bierbaum wrote: >> >>> Hello all: >>> >>> I am just starting to play with the new WeakPtr types in OpenSG. Very nice. >>> >>> I have one suggestion for the documentation. I think we should >>> recommend a usage idiom for people to only use WeakPtr's if they have >>> first been converted to Rec/Ref Ptrs. This would be similar to the >>> recommended usage of boost weak pointers. >>> (http://www.boost.org/doc/libs/1_38_0/libs/smart_ptr/weak_ptr.htm) >>> >>> >> +1. >> > > Can we enforce this by not having conversions for weak pointers or is that too > much of a hassle? > It seems to be the best way. You could always .get() it to a raw ptr if you knew you had a reference-chain to it. Cheers, /Marcus |