title: Template metaprogram to find similar consecutive typenames
body: <p>I am new to template meta programming and was trying to create a program that would find if a parameter pack has consecutive same type names. For example <code>&lt;int, int&gt;</code>, <code>&lt;int, char, char&gt;</code> would return true and <code>&lt;int,char&gt;</code> and <code>&lt;int, char, int&gt;</code> would not.</p>
  
  <p>I managed to write this piece of code but it seems to be comparing each value of parameter pack with itself. I am just looking for a way to iterate through the values of parameter pack to compare with it's consecutive element.</p>
  
  <pre><code>template&lt;typename T, typename U&gt;
  struct sameTypename{
      enum {value = false};
  };
  
  template&lt;typename T&gt;
  struct sameTypename&lt;T, T&gt;{
      enum {value = true};
  };
  
  template &lt;typename T, typename ...args&gt;
  struct consTypename{
      enum {value = (sameTypename&lt;consTypename&lt;args...&gt;, consTypename&lt;args...&gt;&gt;::value)};
  };
  
  template &lt;typename T&gt;
  struct consTypename&lt;T, T&gt;{
      enum {value = true};
  };
  
  template &lt;typename T&gt;
  struct consTypename&lt;T&gt;{
      enum {value = false};
  };
  </code></pre>