简体   繁体   中英

c++ vector iterator conversion error

little help guys im still a newbie at c++

error: invalid conversion from 'VboVO* const* const' to 'VboVO**'

im getting this error when trying to compile. here is the relevant parts of my code

struct VboVO{..};
vector<VboVO*> m_vboVos;
vector<VboVO*>::iterator iVbovo;

for(iVbovo = m_vboVos.begin() ; iVbovo != m_vboVos.end(); ++iVbovo){
}

This is a guess

You are probably trying to perform this loop in a const member function of some class, with m_vboVos as a member variable. Therefore m_vboVos is const , and you cannot use an iterator with a const vector . Use const_iterator instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM