
-----------------------------------
abcdefghijklmnopqrstuvwxy
Thu Jan 25, 2007 3:11 am

Using member functions inside boolean statements.
-----------------------------------
Hey.  Is there anything I should know about boolean statements and using functions inside them?  

Look at this code:


void handle_tac_events(std::vector& vTacs, std::vector::iterator iter, std::vector::iterator end, int& x, int& y, Board& board)
{
  int result;
  for (; iter != end ; ++iter)
  {
    result = iter->handleEvents(x, y, board);
    if (result == MOVED_A_TAC )
    {  
      vTacs.push_back(Tac(iter->getColor(), board));
      return;
    }
    else if (result == CLICKED_A_TAC)
    {
      return;
    }
  } 
  return;
}


If i substitute "iter->handleEvents(x, y, board)" with result in the if statements why does it not ever return true?  Whereas with result in its place it works fine...
