title: Soldity: Iterate through address mapping
body: <p>I am looking for a way to iterate through a mapping in Solidity. For example I have this mapping:</p>
  
  <p><code>mapping (address =&gt; uint) private shares;</code></p>
  
  <p>And I want to iterate in a function through all addresses and send them ether according to their shares.</p>
  
  <p>Something like:</p>
  
  <pre><code>function giveOutEth() onlyOwner returns (bool success){
  for(uint i=0; i &lt; shares.length ; i++){
  //get the address and send a value
  }
  </code></pre>
  
  <p>}</p>
  
  <p>How can I achieve this?</p>
  
  <p>Thanks</p>