Skip to content

Instantly share code, notes, and snippets.

@Bueddl
Created January 22, 2017 21:23
Show Gist options
  • Save Bueddl/44dc866f12c7493fccdef8958a161bb8 to your computer and use it in GitHub Desktop.
Save Bueddl/44dc866f12c7493fccdef8958a161bb8 to your computer and use it in GitHub Desktop.
template<class T, class... Ts>
struct _sizeof
{
static constexpr std::size_t value = 1 + _sizeof<Ts...>();
};
template<class T>
struct _sizeof<T>
{
static constexpr std::size_t value = 1;
};
template<class... Ts>
static constexpr std::size_t _sizeof_v = _sizeof<Ts...>::value;
// _sizeof_v<Ts....>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment