[osg-users] Returning ref_ptr<> vs. ref_ptr<>::get()

Paul Martz pmartz at skew-matrix.com
Thu Sep 11 09:37:07 PDT 2008

> The example in the middle of page 37, above the one Cliff 
> cited, looks like it won't compile.  Did you really mean to 
> return *grp?  I know it's meant to show bad programming 
> practice but the book reads like it should compile.

You are correct, that code is wrong. I meant to return grp.get() as an
example of returning a dangling pointer.

I've added this to the errata at http://www.skew-matrix.com/osgqsg/. Thanks
for catching this.

Paul Martz
Skew Matrix Software LLC
+1 303 859 9466

More information about the osg-users mailing list