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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to