Hi Bruno, On 29 May 2017 at 13:42, Bruno Oliveira <[email protected]> wrote: > in array setters, for instance in osg::Geometry::setVertexArray, why is the > array argument non-const?
osg::Geometry takes/shares ownership of the array you pass in so it's free to delete, modify it, or other parts of the OSG/your application are free to modify it, so it can't enforce that the array you pass in is const. If you can't enforce it being const that having a const input would be misleading. > How bad is it that I const_cast an array of my into a Geometry? It's not bad, unless your application relies on no other part of the OSG/your application modifying that array so actually intend it to be fully const. Hopefully it will flag up that fact that the assumptions you might have been previously making might no longer hold. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

