fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct A
  5. {
  6. void operator() () { cout << "A()\n"; }
  7. };
  8.  
  9. struct B
  10. {
  11. void operator() (int x) { cout << "B(" << x << ")\n"; }
  12. };
  13.  
  14. template<class... Bs>
  15. struct C : Bs...
  16. {
  17. using Bs::operator()...;
  18. };
  19.  
  20. int main()
  21. {
  22. C<A, B> c;
  23. c();
  24. c(42);
  25. }
Success #stdin #stdout 0s 4372KB
stdin
Standard input is empty
stdout
A()
B(42)