title: for_each C++ Problem
body: <p>I'm confused about the for each loop in C++. I have this code in a main game loop: </p>
  
  <pre><code>for each (Bubble b in bubbles){
      b.Update();
  }
  for each (Bubble b in bubbles){
      b.Draw();
  }
  </code></pre>
  
  <p>It doesn't update anything, but does draw 1 bubble.. What's wrong with it?</p>
  
  <p>EDIT: This code works </p>
  
  <pre><code>struct BubbleUpdater {
  void operator()(Bubble &amp; b) { b.Update(); }
  } updater;
  struct BubbleDrawer {
  void operator()(Bubble &amp; b) { b.Draw(); }
  } drawer;
  
  void OnTimer(){ //this is my main game loop
      std::for_each(bubbles.begin(),bubbles.end(),drawer);
      std::for_each(bubbles.begin(),bubbles.end(),updater);
  }
  </code></pre>