On 2/5/2013 1:32 PM, Nathan Mielcarek wrote:
Hi all,
This just came up at work a few days ago since I was confused why both
assignment methods performed the same way.
I agree that the cmake option should be removed and set to a default to avoid
confusion. I don't have a preference for that default since the changes needed
to switch our code to either one should be minor.
Just to be clear, with the CMake variable ON, both assignments will compile and
function properly:
osg::Group* dest;
osg::ref_ptr< osg::Group > refPtrToGrp;
dest = refPtrToGrp.get(); // OK when ON
dest = refPtrToGrp; // OK when ON
But when set to OFF, use of ref_ptr::get() is required.
dest = refPtrToGrp.get(); // OK when OFF
dest = refPtrToGrp; // Error when OFF
So, if we remove the variable but leave the code behaving in the ON state, then
there would be no changes required in your code. Either assignment would work
fine. But you might want to globally change it to one or the other just for
consistency. :-)
-Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org