#include <iostream>

template<typename T, T ...>
struct add_all;

template<typename T, T X, T ... Rest>
struct add_all<T,X,Rest...>
{
	constexpr static T value = X + add_all<T, Rest...>::value;
};

template<typename T>
struct add_all<T>
{
	constexpr static T value = 0;
};

template<typename ... T>
void test()
{
	constexpr auto size = add_all<std::size_t, sizeof(T)...>::value;
	std::cout << size << std::endl;
}

int main()
{
	test<int,char, double, char*>();
}