title: Filter the tuple types with templates in C++
body: <p>I need to check the types of the tuple with type traits. And if the type is appropriate it should stay, if it is not its continues.</p>
  <p>For example:</p>
  <pre><code>using TUPLE = tuple&lt;int, float,char, short, string, double, float&gt;;
  using TUPLE_INTEGRAL = filter_types_t&lt;is_integral&lt;void&gt;, TUPLE&gt;;
  TUPLE_INTEGRAL --&gt; tuple&lt;int, char, short&gt;
  </code></pre>
  <p>Up to now, ı did something like this,</p>
  <pre><code>template &lt;typename Pred, typename Tuple&gt; struct filter_types;
  
  template &lt;typename t_Predicate, typename ...Ts&gt;
  struct filter_types&lt;t_Predicate, std::tuple&lt;Ts...&gt;&gt;
  {
      
      template&lt;class E&gt;
      using t_filter_impl = std::conditional_t&lt;
          t_Predicate&lt;E&gt;::value,
          std::tuple&lt;E&gt;, std::tuple&lt;&gt;&gt;;
  
      
      using filter_types_t = decltype(std::tuple_cat(std::declval&lt;t_filter_impl&lt;Ts&gt;&gt;()...));
  };
  </code></pre>
  <p>But it's not compiling and gives an error.</p>