title: C++11 way to write template for picking bigger integer type?
body: <p>At compile time in C++11 in a template function that takes 2 template parameters, both of which must be unsigned integer types, I'd like to have a local variable have the type of whichever of the two template parameters has more bits. In C++03 I might write something like:</p>
  
  <pre><code>template&lt;bool, class T, class U&gt;
  struct pick_first;
  
  template&lt;class T, class U&gt;
  struct pick_first&lt;true, T, U&gt; {
      typedef T type;
  };
  
  template&lt;class T, class U&gt;
  struct pick_first&lt;false, T, U&gt; {
      typedef U type;
  };
  
  template&lt;class T, class U&gt;
  struct pick_bigger {
      typedef typename pick_first&lt;(sizeof(T) &gt;= sizeof(U)), T, U&gt;::type type;
  };
  
  // usage
  template&lt;class uintX_t, class uintY_t&gt;
  void foo() {
      typename pick_bigger&lt;uintX_t, uintY_t&gt;::type mylocal = 0;
      // insert doing stuff with mylocal here
  }
  </code></pre>
  
  <p>Can I leverage any of the new C++11 features to make this simpler? I know I could use variadic templates to make it work with more than just pairs of types, and instead of using pick_first I could write lots of specializations to make it work with the new int_leastX_t and int_fastX_t types. But I'm curious if there's just a plain better approach to this. Maybe somehow leveraging auto/constexpr/decltype?</p>