title: How can I check type T is among parameter pack Ts...?
body: <p>I want to write a function to return true if <code>T</code> is one of <code>Ts...</code></p>
  
  <pre><code>template&lt;class T, class... Ts&gt;
  bool is_one_of&lt;T, Ts...&gt;();
  </code></pre>
  
  <p>For example, <code>is_one_of&lt;int, double, int, float&gt;</code> returns <code>true</code>, and <code>is_one_of&lt;int, double, std::string, bool, bool&gt;</code> returns <code>false</code>.</p>
  
  <p>My own implementation is</p>
  
  <pre><code>template&lt;class T1, class T2&gt;
  bool is_one_of&lt;T1, T2&gt;() {
      return std::is_same&lt;T1, T2&gt;;
  }
  
  template&lt;class T1, class T2, class... Ts&gt;
  bool is_one_of&lt;T1, T2, Ts...&gt;() {
      if (std::is_same&lt;T1, T2&gt;) {
          return true;
      }
      else {
          return is_one_of&lt;T1, Ts...&gt;();
      }
  }
  </code></pre>
  
  <p>This check seems common to me so I wonder if there's already such a function in the standard library. </p>