title: Modify contents in foreach
body: <p>I tend to use ArrayLists of structures. It is then very easy to cycle through the list with a foreach.</p>
  
  <p>The problem I have is I cant use a foreach to modify the structures contents and have to use a for and messy typecasts. </p>
  
  <pre><code>((dataStructure)files[x]).name = here;
  </code></pre>
  
  <p>Is there a tidier way to do it?</p>