#include <iostream>
#include <utility>
using namespace std;
template < typename ... list > struct typeList;
template < typename , typename > struct zipper;
template < typename ...L , typename ...R > struct zipper< typeList< L...> , typeList< R...>> : std:: tuple < std:: pair < L,R> ...>
{
typedef std:: tuple < std:: pair < L,R> ...> tuplez;
static_assert( sizeof ...( L) == sizeof ...( R) , "Mismatch number of Args..." ) ;
static void print( )
{
std:: cout << "The types are: " << std:: endl ;
for ( int i= 0 ; i< std:: tuple_size < tuplez> :: value ; ++ i)
std:: cout << "first : " << typeid ( std:: tuple_element < i, tuplez> :: type :: first_type ) .name ( ) <<
"second : " << typeid ( std:: tuple_element < i, tuplez> :: type :: second_type ) .name ( ) << std:: endl ;
}
} ;
int main( )
{
zipper< typeList< int ,double > , typeList< char ,int >> :: print ( ) ;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dXRpbGl0eT4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnRlbXBsYXRlPHR5cGVuYW1lLi4uIGxpc3Q+IHN0cnVjdCB0eXBlTGlzdDsKCgp0ZW1wbGF0ZTx0eXBlbmFtZSwgdHlwZW5hbWU+IHN0cnVjdCB6aXBwZXI7CnRlbXBsYXRlPHR5cGVuYW1lLi4uTCwgdHlwZW5hbWUuLi5SPiBzdHJ1Y3QgemlwcGVyPHR5cGVMaXN0PEwuLi4+LCB0eXBlTGlzdDxSLi4uPj4gOiBzdGQ6OnR1cGxlPHN0ZDo6cGFpcjxMLFI+Li4uPgp7CiAgICB0eXBlZGVmIHN0ZDo6dHVwbGU8c3RkOjpwYWlyPEwsUj4uLi4+IHR1cGxlejsKICAgIHN0YXRpY19hc3NlcnQoc2l6ZW9mLi4uKEwpPT1zaXplb2YuLi4oUiksICJNaXNtYXRjaCBudW1iZXIgb2YgQXJncy4uLiIpOwoKICAgIHN0YXRpYyB2b2lkIHByaW50KCkKICAgIHsKICAgIHN0ZDo6Y291dDw8IlRoZSB0eXBlcyBhcmU6ICI8PHN0ZDo6ZW5kbDsKICAgIGZvcihpbnQgaT0wOyBpPHN0ZDo6dHVwbGVfc2l6ZTx0dXBsZXo+Ojp2YWx1ZSA7ICsraSkKICAgIHN0ZDo6Y291dDw8ICJmaXJzdCA6ICI8PCB0eXBlaWQoc3RkOjp0dXBsZV9lbGVtZW50PGksIHR1cGxlej46OnR5cGU6OmZpcnN0X3R5cGUpLm5hbWUoKTw8CiAgICAgICAgInNlY29uZCA6ICI8PHR5cGVpZChzdGQ6OnR1cGxlX2VsZW1lbnQ8aSwgdHVwbGV6Pjo6dHlwZTo6c2Vjb25kX3R5cGUpLm5hbWUoKSA8PHN0ZDo6ZW5kbDsKICAgIH0KfTsKCmludCBtYWluKCkKewogICAgemlwcGVyPHR5cGVMaXN0PGludCxkb3VibGU+LCB0eXBlTGlzdDxjaGFyLGludD4+OjpwcmludCgpOwogICAgcmV0dXJuIDA7Cn0K
compilation info
prog.cpp:9:96: error: expected template-name before '<' token
prog.cpp:9:96: error: expected '{' before '<' token
prog.cpp:9:96: error: expected unqualified-id before '<' token
prog.cpp: In function 'int main()':
prog.cpp:25:5: error: incomplete type 'zipper<typeList<int, double>, typeList<char, int> >' used in nested name specifier
stdout