As Ulrich said, it's a bad idea.

osg::ref_ptr works from _withing_ the object (roughly) while
std::shared_ptr works from the outside.

You'll have to use the osg::ref_ptr for everything that is osg:: and
std::shared_ptr for everything else.

There is also the osg::observer_ptr for 'weak' references.

--
Alexandre Vaillancourt


2013/7/31 Ulrich Hertlein <[email protected]>

> On 29/04/2013 2:53, Maik Klein wrote:
> > I am wondering if it is possible to use the c++11 smartpointer instead of
> > osg::ref_ptr?
> > Is there any advantage in using the osg::ref_ptr?
>
> Mixing the two is a bad idea, as they will happily ignore one another ;-)
>
> One benefit of osg::ref_ptr is that the reference count is part of the
> object, so even if
> you return a raw pointer at some point you could stuff it back into a
> ref_ptr without
> things getting stuffed up.
>
> /ulrich
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to