#include <tuple>
template < template < typename ...> class T, typename >
struct instantiate_with_arg_pack { } ;
template < template < typename ...> class T
, template < typename ...> class U
, typename ... Ts >
struct instantiate_with_arg_pack< T, U< Ts...>>
{
using type = T< Ts...> ;
} ;
template < class T>
using to_tuple = typename instantiate_with_arg_pack< std:: tuple , T> :: type ;
template < typename T = int , typename U = double > struct exampl { } ;
template < typename T> struct TD;
int main( )
{
using Tuple = to_tuple< exampl<>> ;
TD< exampl< std:: tuple_element_t < 1 , Tuple> , std:: tuple_element_t < 0 , Tuple>> > td; // should swap default template parameters
}
I2luY2x1ZGUgPHR1cGxlPgoKCnRlbXBsYXRlPHRlbXBsYXRlPHR5cGVuYW1lLi4uPiBjbGFzcyBULCB0eXBlbmFtZT4Kc3RydWN0IGluc3RhbnRpYXRlX3dpdGhfYXJnX3BhY2sgeyB9OwoKdGVtcGxhdGU8IHRlbXBsYXRlPHR5cGVuYW1lLi4uPiBjbGFzcyBUCiAgICAgICAgLCB0ZW1wbGF0ZTx0eXBlbmFtZS4uLj4gY2xhc3MgVQogICAgICAgICwgdHlwZW5hbWUuLi4gVHM+CnN0cnVjdCBpbnN0YW50aWF0ZV93aXRoX2FyZ19wYWNrPFQsIFU8VHMuLi4+Pgp7CiAgICB1c2luZyB0eXBlID0gVDxUcy4uLj47Cn07Cgp0ZW1wbGF0ZTxjbGFzcyBUPgp1c2luZyB0b190dXBsZSA9IHR5cGVuYW1lIGluc3RhbnRpYXRlX3dpdGhfYXJnX3BhY2s8c3RkOjp0dXBsZSwgVD46OnR5cGU7CgoKdGVtcGxhdGU8dHlwZW5hbWUgVCA9IGludCwgdHlwZW5hbWUgVSA9IGRvdWJsZT4gc3RydWN0IGV4YW1wbCB7fTsKCgp0ZW1wbGF0ZTx0eXBlbmFtZSBUPiBzdHJ1Y3QgVEQ7CgoKaW50IG1haW4oKQp7CiAgICB1c2luZyBUdXBsZSA9IHRvX3R1cGxlPGV4YW1wbDw+PjsKICAgIFREPCBleGFtcGw8c3RkOjp0dXBsZV9lbGVtZW50X3Q8MSwgVHVwbGU+LCBzdGQ6OnR1cGxlX2VsZW1lbnRfdDwwLCBUdXBsZT4+ID4gdGQ7IC8vIHNob3VsZCBzd2FwIGRlZmF1bHQgdGVtcGxhdGUgcGFyYW1ldGVycwp9
compilation info
prog.cpp: In function 'int main()':
prog.cpp:28:82: error: aggregate 'TD<exampl<double, int> > td' has incomplete type and cannot be defined
TD< exampl<std::tuple_element_t<1, Tuple>, std::tuple_element_t<0, Tuple>> > td; // should swap default template parameters
^
stdout