title: Variadic templates and function objects
body: <p>Lets say that we have two function objects that take an int and return a boolean:</p>
  <pre><code>struct EvenNumber {
    bool operator()(int const num) const {
     return num % 2 == 0;
    }
  }
  
  struct GreaterThenFive {
    bool operator()(int const num) const {
      return num &gt; 5;
    }
  }
  </code></pre>
  <p>now let's say that we have a function that takes a vector and a variadic template of filters. The function should return a new vector containing only those elements from the original vector that satisfy filtering operations:</p>
  <pre><code>template &lt;typename... Filters&gt;
  std::vector&lt;int&gt; filter_out(std::vector&lt;int&gt; const&amp; vec, Filters&amp;&amp;... filters) {
    std::vector&lt;int&gt; result;
  
    for (int const num : vec) {
      if (std::forward&lt;filters&gt;(filters)(num)...) {
        result.push_back(num);
      }
    }
  
    return result;
  }
  </code></pre>
  <p>But this doesn't work with unexpected token ...; expected ). do we need fold expression here? how should the syntax look if we want to perform all filtering operations on all numbers of the original vector?</p>
  <p>calling code can look like this:</p>
  <pre><code>auto result = filter_out({1, 2, 3, 4, 5, 6, 7}, EvenNumber{}, GreaterThenFive{});
  </code></pre>