typedef yourtype ltype;
std :: list <ltype> yourlist;
typedef std :: list <ltype> :: iterator pos = yourlist.begin ();
for (unsigned int i = 0; pos! = yourlist.end (); pos ++)
{
i ++;
if (i == 7)
break;
}
if (i == 7)
ltype lt = * pos;
You can use iterators directly at specified positions ++
for (it = mylist.begin (), i = 0; it! = mylist.end (); it ++, i ++)
{
if (i> 6)
break;
}
if (i == 7)
{...} // found