I have this old piece of code (modified to be compilable), which I would assume gives a warning for variable redefinition on pos, but it doesn't. Could anyone tell me why it doesn't ?
Kind Regards
https://www.onlinegdb.com/ByUR079yS
#include <iostream>
#include <vector>
using namespace std;
struct foo
{
std::vector<int*> bar;
};
int main()
{
std::vector<foo*> m_ListCilinders;
for (std::vector<foo*>::iterator pos = m_ListCilinders.begin(); pos != m_ListCilinders.end(); pos++)
{
foo* pCilinder = *pos;
for (std::vector<int*>::const_iterator pos = pCilinder->bar.begin(); pos != pCilinder->bar.end(); pos++)
{
int* pLevering = *pos;
}
}
return 0;
}