*MyIterator->AnotherMethod(); should be " MyIterator->AnotherMethod(); "
On Dec 30, 2007 12:47 AM, Renan Mendes <[EMAIL PROTECTED]> wrote: > Hi, everyone. > > I've got quick question on STL vectors. > > I've created a class (let's call it MyClass) with the method 'bool > MyMethod(std::vector<MyClass> MyVector)' that calls another method 'void > AnotherMethod()' that makes a simple check on a variable inherent to every > instance of MyClass. > > > How do I write that method? Or better put: how do I change the following > code to make it right? > > bool MyClass::MyMethod(std::vector<MyClass> MyVector) > { > std::vector<MyClass>::iterator MyIterator; > > for(MyIterator = MyVector.begin(); MyIterator != MyVector.end(); > MyIterator++) > { > *MyIterator->AnotherMethod(); > } > } > > I read that an iterator was a pointer to the content of the vector, why > doesn't it work? > > > Thanks, > > > Renan M Z Mendes > > _______________________________________________ > 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