It looks like you have figured out what you need. I would like to
belabor this a tad bit more to point out a common confusion with
pointers. It took me a long time to get my head around this when I was
learning C++ and it delayed my adoption of copious const usage.

  const osg::ref_ptr< MyObject >   is like   MyObject * const
  osg::ref_ptr< const MyObject >   is like   const MyObject *

The syntax here is just inherently confusing. I personally prefer to
write the const qualifier on the other side of the type. That way you
can read types from right to left more naturally.

  MyObject const *  is a "pointer to a const MyObject"
  MyObject * const  is a "const pointer to a MyObject" 

Hopefully this will clarify things a little so you don't have to spend
as much time as I did getting your head around this.

Frank

On Wed, 2010-05-19 at 12:11 +0200, Gianni Ambrosio wrote:
> Hi Michael,
> 
> Il 5/19/2010 11:55 AM, Michael Platings ha scritto:
> > Hi Gianni,
> > what you're looking for is this:
> >
> > std::vector<osg::ref_ptr<const MyObject> >
> >
> > This means the pointer can change, but it can't be used to alter the 
> > object it points at.
> 
> Thanks for the suggestion. That's good.
> 
> Thanks also Peter and Alberto for their contribution.
> 
> Regards
> Gianni
> 
> 
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to