metafunction to determinate the biggest of all supplied types Can the metafunction below be implemented more elegantly, with less code? What I have now is not very elegant or smartly written.

#include &lt;type_traits&gt;

namespace detail
{

template &lt;typename T, typename A, typename ...B&gt;
struct max_type
{
  typedef typename max_type&lt;
    typename std::conditional&lt;(sizeof(A) &gt; sizeof(T)), A, T&gt;::type,
    B...
  &gt;::type type;
};

template &lt;typename T, typename A&gt;
struct max_type&lt;T, A&gt;
{
  typedef typename std::conditional&lt;(sizeof(A) &gt; sizeof(T)), A, T&gt;::type type;
};

}

template &lt;typename A, typename... B&gt;
struct max_type
{
  typedef typename detail::max_type&lt;A, A, B...&gt;::type type;
};
How about this? It’s not all that much shorter, but IMHO quite a bit simpler:

#include &lt;type_traits&gt;

template &lt;typename A, typename... B&gt;
struct max_type
{
    typedef typename max_type&lt;A, typename max_type&lt;B...&gt;::type&gt;::type type;
};

template &lt;typename A&gt;
struct max_type&lt;A&gt;
{
    typedef A type;
};

template &lt;typename A, typename B&gt;
struct max_type&lt;A,B&gt;
{
    typedef typename std::conditional&lt;(sizeof(A) &gt; sizeof(B)), A, B&gt;::type type;
};