#include <boost/preprocessor.hpp>

struct O
{
	template <class T1, class T2>
	struct A {};
};

template<class T>
struct argument_type;
template<class T, class U>
struct argument_type<T(U)>
{
	using type = U;
};

#define TDEF(TYPE, NAME) using NAME = argument_type<void(TYPE)>::type
#define INHERIT(R, DATA, ELEM) , argument_type<void(BOOST_PP_SEQ_ELEM(0, ELEM))>::type
#define MEMBER(R, DATA, ELEM) TDEF(BOOST_PP_SEQ_ELEM(0, ELEM), BOOST_PP_SEQ_ELEM(1, ELEM));
#define CREATE_CLASS(NAME, MEMBERS) \
	struct NAME \
		: argument_type<void(BOOST_PP_SEQ_ELEM(0, BOOST_PP_SEQ_HEAD(MEMBERS)))>::type \
		BOOST_PP_SEQ_FOR_EACH(INHERIT, _,  BOOST_PP_SEQ_TAIL(MEMBERS)) \
	{ \
	 	BOOST_PP_SEQ_FOR_EACH(MEMBER, _, MEMBERS) \
	}

CREATE_CLASS(test_class, (((O::A<int*, int>))(val)));

int main()
{
}