Search code examples
c++iteratordequeogre

deque iterator OGRE


ok si have i have the following code:

for(deque<Ogre::Vector3>::iterator iter(mWalkList.begin()); iter != mWalkList.end() ;  iter++){
            String tmpstr="Knot"+Ogre::StringConverter::toString(n);
            ent = mSceneMgr->createEntity(tmpstr, "knot.mesh");
            tmpstr = "Knot"+Ogre::StringConverter::toString(n)+"Node";
            node = mSceneMgr->getRootSceneNode()->createChildSceneNode(tmpstr,*iter);
            node->attachObject(ent);
            node->setScale(0.1f, 0.1f, 0.1f);
            n++;
        }  

But visual studio gives me a error when i hover hover iterator iter which says the following: Error: class "Ogre::deque<Ogre::Vector3, Ogre::STLAllocator<Ogre::Vector3, Ogre::GeneralAllocPolicy>>" has no member 'iterator'

what am i doing wrong,

sorry im new to Ogre and C++ for that matter, Its a school project so i would really appreciate some help.


Solution

  • Try using std::deque<Ogre::Vector3> instead of deque<Ogre::Vector3> (which is Ogre::deque<Ogre::Vector3> in this case).

    Or you can use Ogre::deque<Ogre::Vector3>::type. The docs seem to say that is the same as the std::deque above.