title: Deducing value type from iterator for return type of template function
body: <p>Just experimenting with multiple return values using this simple snippet that calculates sum and mean from a container. </p>
  
  <pre><code>template&lt;typename Iter&gt;
  std::tuple&lt;double, double&gt; summean(Iter first1, Iter last1)
  {
      double sum = std::accumulate(first1, last1, 0.0);
      double mean = sum / (last1-first1);
  
      return {sum, mean};
  }
  </code></pre>
  
  <p>The demo uses double precision calculation just as a demo. Is there an elegant way to use the precision of the values in the container in the calculations for the return types of the tuple?</p>