title: How can you statically check that a type T exists in a variadic template parameter list
body: <p>I am trying to statically check to see if a type exists in a variadic template parameter list. However, this template list actually exists within a class that is passed a single type. The answer <a href="https://stackoverflow.com/questions/17032310/how-to-make-a-variadic-is-same">here</a> shows how to check a list of parameters or a parameter pack, but I am unsure how to test a class that contains variadic templates.</p>
  
  <p>For example</p>
  
  <pre><code>template &lt;typename ...S&gt;
  class Services {};
  
  template &lt;typename Services&gt;
  class ServiceLocator
  {
  public:
        template &lt;typename T&gt;
        T&amp; Resolve() 
        { 
             static_assert( check_t_exists_in_variadic_template_within_Services );
             return Find&lt;T&gt;();  
        }
  
  };
  </code></pre>
  
  <p>What could I write in this static_assert to ensure that each call to this service locator is checked and a compiler error thrown if Resolve is called with a type that does not exist in the template parameter list inside Services?</p>
  
  <p>What I am specicially after is something along the lines of:</p>
  
  <pre><code>static_assert(is_any&lt;T,Services::S...&gt;::value, "T does not exist in Services::S");
  </code></pre>