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

Jolley, Thomas P thomas.p.jolley at boeing.com
Thu Sep 11 07:12:51 PDT 2008

Hi Paul Martz,

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

osg::Group* CreateGroup()
   osg::ref_ptr<osg::Group> grp = new osg::Group;
   return *grp;

> -----Original Message-----
> From: Cliff Taylor [mailto:bloodgain at gmail.com] 
> Sent: Wednesday, September 10, 2008 1:23 PM
> To: osg-users at lists.openscenegraph.org
> Subject: [osg-users] Returning ref_ptr<> vs. ref_ptr<>::get()
> osg::ref_ptr<osg::Group> createGroup()
> {
>   osg::ref_ptr<osg::Group> grp = new osg::Group;
>   //comments
>   return grp.get()
> }

More information about the osg-users mailing list