Loop through vector

I want to loop through this vector:

 
  std::vector<DynamicSdmProtocol::DynamicSdm*>  m_devices;


I am getting an error when trying to loop through it in the following way:

 
for (int i = 0; i < m_devices.size(); ++i)


the error is:
no matching function for call to 'std::vector<DynamicSdmProtocol::DynamicSdm*, std::allocator<DynamicSdmProtocol::DynamicSdm*> >::size(int)'

what should my upper bound be if not the size of the vector?
From the error message it looks like you are trying to pass an integer as argument to the size() function.
size is correct.
it looks like its having trouble finding size() ... does it need a std:: or something?
alternatively, have you been able to use the vector before this loop, to populate it or anything, and that works?
Last edited on
Ah I see now, this was my fault, size() is correct.
Topic archived. No new replies allowed.