fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Yoba{
  5. };
  6.  
  7. class Yoba1{
  8. Yoba1(char l){}
  9. };
  10.  
  11. class Yoba2{
  12. Yoba2(int l){}
  13. };
  14.  
  15. template<typename T>
  16. Yoba foo(int type, T val) {
  17. switch(type) {
  18. case 0 : return new Yoba1(val);
  19. case 1 : return new Yoba2(val);
  20. }
  21. }
  22.  
  23.  
  24. int main() {
  25. // your code goes here
  26. return 0;
  27. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Standard output is empty