title: Is unpacking variadic using array(or initializer_list) trick optimize-safe?
body: <p>Since C++14 cannot use fold expression, in order to make a function that calls <code>bar</code> on each variadics, one have to use function overloading.</p>
  <pre><code>template&lt;typename Arg&gt;
  void foo(Arg arg) {
    bar(arg);
  }
  
  template&lt;typename Arg, typename ...Args&gt;
  void foo(Arg arg, Args... args) {
    bar(arg);
    foo(args...);
  }
  </code></pre>
  <p>But using comma operator and parenthesis in bracket, one can unpack without overload.</p>
  <pre><code>template&lt;typename ...Args&gt;
  void foo(Args... args) {
    int dummy[] = {
      (bar(args), 0)...
    };
  }
  </code></pre>
  <p>It works well as expected, but my compiler always warns me that <code>dummy</code> is not used.
  So I'm worried that the compiler removes <code>dummy</code>(since it's unused and actually initialized only by literals), and resulting to not calling <code>bar</code>.<br />
  Or just declaring <code>dummy</code> as <code>volatile</code> is enough to be guarantee that <code>bar</code> is called?<br />
  I know that there is <code>[[maybe_unused]]</code> attribute, but it's also C++17 feature.</p>