title: How to filter a std::integer_sequence
body: <p>If I theoretically have a sequence of integers like</p>
  
  <pre><code>std::integer_sequence&lt;int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9&gt;
  </code></pre>
  
  <p>How can I filter it with some compile-time predicate to get a potentially smaller <code>std::integer_sequence&lt;int, ...&gt;</code>?</p>
  
  <p>For the sake of argument, let's say that I want only the even values,
  which leads to the question of "How can I make the following static_assert (or something close) pass?"</p>
  
  <pre><code>static_assert(std::is_same_v&lt;std::integer_sequence&lt;int, 0, 2, 4, 6, 8&gt;,
                decltype(FilterEvens(std::integer_sequence&lt;int, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9&gt;{}))&gt;, 
                "Integer sequences should be equal");
  </code></pre>
  
  <p><br/><br/>
  <sup>This question was inspired by thinking about how we might accomplish removing duplicates between two bitsets (<a href="https://stackoverflow.com/questions/41720249/detecting-matching-bits-in-c#comment70636187_41720249">this question</a>), assuming we could represent the bitsets as <code>integer_sequences</code> containing only 0 and 1. Bonus points if you can solve that one in this manner, too</sup></p>