[osg-users] META_object macro returning osg::Object* for cloneType and clone

Hartwig Wiesmann hartwig.wiesmann at skywind.eu
Sun Nov 26 10:10:26 PST 2017


Hi,

if you have a list of pointer of derived classes from osg::Object and you would like to clone them you always have to cast them. And I like to prevent casts as often as possible.

Example: if you clone a StateAttribute you get back a pointer to an Object although you know (and the compiler could also know) that the result is a StateAttribute.

Cheers,
Hartwig

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72461#72461







More information about the osg-users mailing list