title: Confusing templates in C++17 example of std::visit
body: <p>When looking at <code>std::visit()</code> page in cppreference,
  <a href="https://en.cppreference.com/w/cpp/utility/variant/visit" rel="noreferrer">https://en.cppreference.com/w/cpp/utility/variant/visit</a>, I encountered the code I can't make sense of... </p>
  
  <p>Here's the abbreviated version:</p>
  
  <pre><code>#include &lt;iomanip&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;type_traits&gt;
  #include &lt;variant&gt;
  #include &lt;vector&gt;
  
  template&lt;class... Ts&gt; struct overloaded : Ts... { using Ts::operator()...; };
  template&lt;class... Ts&gt; overloaded(Ts...)-&gt;overloaded&lt;Ts...&gt;;
  
  int main() {
      std::vector&lt;std::variant&lt;int,long,double,std::string&gt;&gt; vec = { 10, 15l, 1.5, "hello" };
      for (auto&amp; v : vec) {
          std::visit(overloaded{
              [](auto arg) { std::cout &lt;&lt; arg &lt;&lt; ' '; },
              [](double arg) { std::cout &lt;&lt; std::fixed &lt;&lt; arg &lt;&lt; ' '; },
              [](const std::string&amp; arg) { std::cout &lt;&lt; std::quoted(arg) &lt;&lt; ' '; },
              }, v);
      }
  }
  </code></pre>
  
  <p>What do the two lines declaring <code>overloaded</code>, just above <code>int main()</code>, mean? </p>
  
  <p>Thank you for explaining!</p>
  
  <p><strong>2019 Addition</strong><br>
  After the two gentlemen below provided detailed explanations (thank you so much!), I've stumbled upon the same code in the very fine book <em>C++17 in Detail - 
  Learn the Exciting Features of The New C++ Standard!</em> by Bartłomiej Filipek. Such a well written book!</p>