Could it be this(it's other loop but still list and hard to find tutorial)?
40 MainMenu::MenuResult MainMenu::HandleClick(int x, int y)
41 {
42 std::list<MenuItem>::iterator it;
43
44 for ( it = _menuItems.begin(); it != _menuItems.end(); it++)
45 {
46 sf::Rect<int> menuItemRect = (*it).rect;
47 if( menuItemRect.Bottom > y
48 && menuItemRect.Top < y
49 && menuItemRect.Left < x
50 && menuItemRect.Right > x)
51 {
52 return (*it).action;
53 }
54 }
55
56 return Nothing;
57 }
That's from game from scratch c++ edition part 3 : http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition-Part-3.aspx