title: Variadic template parameters and policies
body: <p>I'm writting a policy based logging system while learning a bit of C++ as a hobby. Seems to be a pretty classic exercise. But I have run into a problem I can't solve.</p>
  
  <p>I'm using a variadic template to pass any parameters in the Sink constructorto the writerPolicy as some of the policies need a parameter.</p>
  
  <pre><code>template &lt;class FilterPolicy, class FormatterPolicy ,class WriterPolicy, class ...Ts&gt;
  class Sink
      {
      public:
      Sink(Ts ... p_args) : m_filter(), m_formatter(), m_writer(p_args...){}
  
      virtual void ProcessLogEntry(const Log::LogEntry &amp;data) ;
      private:
      FilterPolicy m_filter;
      FormatterPolicy m_formatter;
      WriterPolicy m_writer;
      }; 
  </code></pre>
  
  <p>The headache starts when I realise that the other policies also might need zero or more parameters passed on to them in the constructor of sink.</p>
  
  <p>Obviously we can't write:</p>
  
  <pre><code>Sink(T1s ... v1s, T2s ... v2s, T3s ... v3s) : m_filter(v1s...), m_formatter(v2...), m_writer(v3s...){}
  </code></pre>
  
  <p>But I can't get my head around this template thing and come up with a good solution, that lets the Sink template figure out which arguments go with witch policies.</p>
  
  <p>My goal is to be able to write</p>
  
  <pre><code>Sink&lt;FilterOnLogLevelPolicy,HTMLFormatPolicy,FileWriterPolicy&gt;(log::DEBUG,"log.html");
  </code></pre>
  
  <p>and have Sink pass the first argument to FilerOnLogLevelPolicy (which takes one parameter in its constructor), none to HTMLFormatPolicy which takes no parameter and the 2nd argument to FileWriterPolicy which needs a filename in the constructor.</p>
  
  <p><strong>HOW?</strong></p>