title: How can I determine the actual type of an 'auto' variable
body: <p>In this response:</p>
  
  <p><a href="https://stackoverflow.com/a/14382318/1676605">https://stackoverflow.com/a/14382318/1676605</a></p>
  
  <p>this program is given:</p>
  
  <pre><code>std::vector&lt;int&gt; vi{ 0, 2, 4 };
  std::vector&lt;std::string&gt; vs{ "1", "3", "5", "7" };
  for (auto i : redi::zip(vi, vs))
      std::cout &lt;&lt; i.get&lt;0&gt;() &lt;&lt; ' ' &lt;&lt; i.get&lt;1&gt;() &lt;&lt; ' ';
  </code></pre>
  
  <p>I have no idea what the type of <code>auto i</code> is, making it harder to reuse expertise and learn from examples. Here is what changing <code>auto i</code> into <code>char i</code> returns</p>
  
  <pre><code>In function ‘int main()’:|
  /data/cbworkspace/TestZip/TestZip.cpp|14|error: cannot convert ‘boost::iterator_facade&lt;boost::zip_iterator&lt;boost::tuples::tuple&lt;__gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt;, __gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt; &gt; &gt;, boost::tuples::cons&lt;int&amp;, boost::tuples::cons&lt;int&amp;, boost::tuples::null_type&gt; &gt;, boost::random_access_traversal_tag, boost::tuples::cons&lt;int&amp;, boost::tuples::cons&lt;int&amp;, boost::tuples::null_type&gt; &gt;, long int&gt;::reference {aka boost::tuples::cons&lt;int&amp;, boost::tuples::cons&lt;int&amp;, boost::tuples::null_type&gt; &gt;}’ to ‘char’ in initialization|
  /data/cbworkspace/TestZip/TestZip.cpp|14|warning: unused variable ‘i’ [-Wunused-variable]|
  ||=== Build finished: 1 errors, 1 warnings (0 minutes, 0 seconds) ===|
  </code></pre>
  
  <p>Try to figure out the type from that.</p>
  
  <p><strong>Is there a way to figure out what the type a variable of an <code>auto</code></strong> is in C++11? To be more clear, I have a <code>struct</code> like this:</p>
  
  <pre><code>struct EventData
  {
      // return value from redi::zip&lt;std::vector&lt;PriceQuote&gt;, std::vector&lt;PriceQuote&gt;&gt; what goes here????? So REDI::Zip is zipping PriceQuote, PriceQuote of bids and asks.
  };
  
  struct PriceQuote
  {
     double price;
     double size;
  };
  </code></pre>