the fact that the "->" operator dereferences the value it returns is a quirky 
rule of C++. "->" behaves a bit like a unary operator but not completely. 
"a->setName()" would resolve to something nonsensical if "(a->)" simply 
resolved to its return type.

so it is a C++ issue.

a->setName() as you have seen is the correct way to call functions on the 
ref_ptr.


    Andy


-----Original Message-----
From: [EMAIL PROTECTED] on behalf of ? ?
Sent: Thu 7/3/2008 10:18 PM
To: [email protected]
Subject: [osg-users] how to ref_ptr -> operator  work?
 
 osg::ref_ptr<osg::Node>  a = new osg:Node;
   a->setName(); //OK
   
  but ref_ptr overload -> operator and  return  a pointer to osg:Node,
  so may  write (a->)->setName()  is right? WHY?
   
  Thanks !
  
   

       
---------------------------------
 ????,??????!

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to