fork download
  1. #include <iostream>
  2.  
  3. struct S1 {
  4. void f() { std::cout << "S1\n"; }
  5. };
  6.  
  7. struct S2 {
  8. void f() { std::cout << "S2\n"; }
  9. void g() {}
  10. };
  11.  
  12. template <class T>
  13. struct D : private T
  14. {
  15. using T::f;
  16. };
  17.  
  18. int main() {
  19. D<S1>().f();
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
S1