title: Argument type auto deduction and anonymous lambda functions
body: <p>Lets say I have these lines of code;</p>
  
  <pre><code>std::vector&lt;int&gt; ints;
  std::for_each(ints.begin(), ints.end(), [](int&amp; val){ val = 7; });
  </code></pre>
  
  <p>However, I dont want to specify the argument type in my lambda functions, ie, I want to write something like this;</p>
  
  <pre><code>std::for_each(ints.begin(), ints.end(), [](auto&amp; val){ val = 7; });
  </code></pre>
  
  <p>Is there anyway this can be achieved?</p>
  
  <p><em>(boost::lambda doesn't need types to be specified...)</em></p>
  
  <hr>
  
  <p><em><strong>Update:</em></strong></p>
  
  <p>For now I use a macro: <code>#define _A(container) decltype(*std::begin(container))</code> so I can do:</p>
  
  <pre><code>std::for_each(ints.begin(), ints.end(), [](_A(ints)&amp; val){ val = 7; });
  </code></pre>