fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. auto l1 = [](int a){cout<<"int\n";};
  5. auto l2 = [](float a){cout<<"float\n";};
  6.  
  7. template<typename T1 = decltype(l1) , typename T2=decltype(l2) >
  8. class A : T1, T2
  9. {
  10. public:
  11. A(): T1(l1), T2(l2){};
  12. using T1::operator();
  13. using T2::operator();
  14.  
  15. };
  16.  
  17. int main() {
  18. // your code goes here
  19. A<decltype(l1), decltype(l2)> a;
  20. a(0);
  21. a(0.0f);
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5424KB
stdin
Standard input is empty
stdout
int
float