typedef bool ( * func) ( int ) ;
//template<typename T = int>
//class TC1{
// public:
// static bool test_func(T t){
// return true;
// }
//};
template < typename T= int >
bool test_func( T) {
return true ;
}
template < func f = & test_func>
class TC2{
public :
TC2( ) {
//uncomment the line below ,compile will pass
//test_func(3);
f( 3 ) ;
}
} ;
template < typename T = char >
class TC3{
public :
TC2<> mc;
TC3( ) = default ;
} ;
int main( ) {
TC3<> tc3;
//uncomment the line below ,compile will pass
//TC2<> mc;
}
dHlwZWRlZiBib29sKCpmdW5jKShpbnQpOwoKLy90ZW1wbGF0ZTx0eXBlbmFtZSBUID0gaW50PgovL2NsYXNzIFRDMXsKLy8gIHB1YmxpYzoKLy8gICAgICBzdGF0aWMgIGJvb2wgdGVzdF9mdW5jKFQgdCl7Ci8vICAgICAgICAgIHJldHVybiB0cnVlOwovLyAgICAgIH0KLy99OwoKdGVtcGxhdGU8dHlwZW5hbWUgVD1pbnQ+CmJvb2wgdGVzdF9mdW5jKFQpewogICAgcmV0dXJuIHRydWU7Cn0KCnRlbXBsYXRlPCBmdW5jIGYgPSAmdGVzdF9mdW5jPgpjbGFzcyBUQzJ7CiAgICBwdWJsaWM6CiAgICAgICAgVEMyKCl7CiAgICAgICAgICAgIC8vdW5jb21tZW50IHRoZSBsaW5lIGJlbG93ICxjb21waWxlIHdpbGwgcGFzcwogICAgICAgICAgICAvL3Rlc3RfZnVuYygzKTsKICAgICAgICAgICAgZigzKTsKICAgICAgICB9Cn07Cgp0ZW1wbGF0ZTx0eXBlbmFtZSBUID0gY2hhcj4KY2xhc3MgVEMzewogICAgcHVibGljOgogICAgICAgIFRDMjw+IG1jOwogICAgICAgIFRDMygpID0gZGVmYXVsdDsKfTsKCmludCBtYWluKCl7CiAgICBUQzM8PiB0YzM7CiAgICAvL3VuY29tbWVudCB0aGUgbGluZSBiZWxvdyAsY29tcGlsZSB3aWxsIHBhc3MKICAgIC8vVEMyPD4gbWM7Cn0=