title: How to get name for each argument in variadic macros?
body: <p>It's possible to create a macro <code>str(a)</code> that will use its argument (<code>a</code>) and its stringified name (<code>#a</code>), for example:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  #define str(a) #a, " ", a
  
  int main()
  {
      int i = 5;
      float f = 4.5;
      const char* s = "string";
  
      auto l = [] (const auto&amp;... p) { (std::cout &lt;&lt; ... &lt;&lt; p) &lt;&lt; std::endl; };
  
      l(str(i));
      l(str(f));
      l(str(s));
  }
  </code></pre>
  
  <p><a href="http://coliru.stacked-crooked.com/a/0461d5020cef3218" rel="noreferrer">Example</a>.</p>
  
  <p>Is there a simple way to print <em>variable</em> number of arguments prepended with a name of each argument? i.e. implement <code>PREPEND_EACH_ARG_WITH_HASH_ARG</code> from the following:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;tuple&gt;
  
  template &lt;typename ... Ts&gt;
  void print_all(const Ts&amp;... ts)
  {
      (std::cout &lt;&lt; ... &lt;&lt; ts) &lt;&lt; std::endl;
  }
  
  #define PREPEND_EACH_ARG_WITH_HASH_ARG(...) // how to implement '#a, " ", a' here?
  #define PRINT_ALL(...) print_all(PREPEND_EACH_ARG_WITH_HASH_ARG(__VA_ARGS__))
  
  int main()
  {
      auto a = 10;
      auto b = 20.1;
      auto c = "string";
      auto d = 'c';
      PRINT_ALL(a, b, c, d);
  }
  </code></pre>
  
  <p><a href="http://coliru.stacked-crooked.com/a/e2a4a028de4d33b2" rel="noreferrer">Example</a>.</p>