Skip to content

Instantly share code, notes, and snippets.

@EricWF
Created March 8, 2016 04:33
Show Gist options
  • Select an option

  • Save EricWF/f12015b4915f675e3679 to your computer and use it in GitHub Desktop.

Select an option

Save EricWF/f12015b4915f675e3679 to your computer and use it in GitHub Desktop.
#include <type_traits>
template <class ...Args, class = typename std::enable_if<sizeof...(Args) == 0>::type>
int maxSize() { return 0; }
template <class First, class ...Args>
int maxSize() {
return sizeof(First) > maxSize<Args...>() ? sizeof(First) : maxSize<Args...>();
}
int main() {
maxSize<>();
maxSize<int, int>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment