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

Alberto Luaces aluaces at udc.es
Thu Sep 11 14:03:31 PDT 2008


El Jueves 11 Septiembre 2008ES 18:37:07 Paul Martz escribió:
> > 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.

Curious. I already had "return *grp" on my hard copy.



More information about the osg-users mailing list